@@ -193,15 +193,15 @@ For ordering or comparison queries we add an `ore` index:
193
193
194
194
``` sql
195
195
SELECT cs_add_index_v2(' users' , ' email_encrypted' , ' ore' , ' text' );
196
- CREATE INDEX ON users (cs_ore_64_8_v2 (email_encrypted));
196
+ CREATE INDEX ON users (ore_block_u64_8_256 (email_encrypted));
197
197
```
198
198
199
199
After adding these indexes, our ` eql_v2_configuration ` table will look like this:
200
200
201
201
``` bash
202
202
id | 1
203
203
state | pending
204
- data | {" v" : 1, " tables" : {" users" : {" email_encrypted" : {" cast_as" : " text" , " indexes" : {" ore" : {}, " match" : {" k" : 6, " m " : 2048, " tokenizer" : {" kind" : " ngram" , " token_length" : 3}, " token_filters" : [{" kind" : " downcase" }], " include_original" : true}, " unique" : {" token_filters" : [{" kind" : " downcase" }]}}}}}}
204
+ data | {" v" : 1, " tables" : {" users" : {" email_encrypted" : {" cast_as" : " text" , " indexes" : {" ore" : {}, " match" : {" k" : 6, " bf " : 2048, " tokenizer" : {" kind" : " ngram" , " token_length" : 3}, " token_filters" : [{" kind" : " downcase" }], " include_original" : true}, " unique" : {" token_filters" : [{" kind" : " downcase" }]}}}}}}
205
205
```
206
206
207
207
The initial ` state ` will be set as pending.
@@ -218,7 +218,7 @@ The `cs_configured_v2` table will now have a state of `active`.
218
218
``` bash
219
219
id | 1
220
220
state | active
221
- data | {" v" : 1, " tables" : {" users" : {" email_encrypted" : {" cast_as" : " text" , " indexes" : {" ore" : {}, " match" : {" k" : 6, " m " : 2048, " tokenizer" : {" kind" : " ngram" , " token_length" : 3}, " token_filters" : [{" kind" : " downcase" }], " include_original" : true}, " unique" : {" token_filters" : [{" kind" : " downcase" }]}}}}}}
221
+ data | {" v" : 1, " tables" : {" users" : {" email_encrypted" : {" cast_as" : " text" , " indexes" : {" ore" : {}, " match" : {" k" : 6, " bf " : 2048, " tokenizer" : {" kind" : " ngram" , " token_length" : 3}, " token_filters" : [{" kind" : " downcase" }], " include_original" : true}, " unique" : {" token_filters" : [{" kind" : " downcase" }]}}}}}}
222
222
```
223
223
224
224
### Encrypting existing plaintext data
@@ -325,7 +325,7 @@ It creates an EQL payload that looks similar to this and inserts this into the e
325
325
"t" : " users" , // Table
326
326
"c" : " email_encrypted" // Encrypted column
327
327
},
328
- "m " : [42 ], // The ciphertext used for free text queries i.e match index
328
+ "bf " : [42 ], // The ciphertext used for free text queries i.e match index
329
329
"u" : " unique ciphertext" , // The ciphertext used for unique queries. i.e unique index
330
330
"ob" : [" a" , " b" , " c" ], // The ciphertext used for order or comparison queries. i.e ore index
331
331
"v" : 1
@@ -386,7 +386,7 @@ The json stored in the database looks similar to this:
386
386
"t" : " users" , // Table
387
387
"c" : " email_encrypted" // Encrypted column
388
388
},
389
- "m " : [42 ], // The ciphertext used for free text queries i.e match index
389
+ "bf " : [42 ], // The ciphertext used for free text queries i.e match index
390
390
"u" : " unique ciphertext" , // The ciphertext used for unique queries. i.e unique index
391
391
"ob" : [" a" , " b" , " c" ], // The ciphertext used for order or comparison queries. i.e ore index
392
392
"v" : 1
@@ -509,7 +509,7 @@ Prerequsites:
509
509
510
510
- An [ ore index] ( #adding-indexes ) is needed on the encrypted column to support this operation.
511
511
512
- EQL function to use: ` cs_ore_64_8_v2 (val JSONB)` .
512
+ EQL function to use: ` ore_block_u64_8_256 (val JSONB)` .
513
513
514
514
A plaintext query order by email looks like this:
515
515
@@ -520,7 +520,7 @@ SELECT * FROM users ORDER BY email ASC;
520
520
The EQL equivalent of this query is:
521
521
522
522
``` sql
523
- SELECT * FROM users ORDER BY cs_ore_64_8_v2 (email_encrypted) ASC ;
523
+ SELECT * FROM users ORDER BY ore_block_u64_8_256 (email_encrypted) ASC ;
524
524
```
525
525
526
526
This query returns:
@@ -538,7 +538,7 @@ Prerequsites:
538
538
539
539
- A [ unique index] ( #adding-indexes ) is needed on the encrypted column to support this operation.
540
540
541
- EQL function to use: ` cs_ore_64_8_v2 (val JSONB)` .
541
+ EQL function to use: ` ore_block_u64_8_256 (val JSONB)` .
542
542
543
543
EQL query payload for a comparison query:
544
544
@@ -564,7 +564,7 @@ SELECT * FROM users WHERE email > 'gracehopper@test.com';
564
564
The EQL equivalent of this query is:
565
565
566
566
``` sql
567
- SELECT * FROM users WHERE cs_ore_64_8_v2 (email_encrypted) > cs_ore_64_8_v2 (
567
+ SELECT * FROM users WHERE ore_block_u64_8_256 (email_encrypted) > ore_block_u64_8_256 (
568
568
' {"v":1,"k":"pt","p":"gracehopper@test.com","i":{"t":"users","c":"email_encrypted"},"q":"ore"}'
569
569
);
570
570
```
0 commit comments