@@ -193,15 +193,15 @@ For ordering or comparison queries we add an `ore` index:
193193
194194``` sql
195195SELECT 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));
197197```
198198
199199After adding these indexes, our ` eql_v2_configuration ` table will look like this:
200200
201201``` bash
202202id | 1
203203state | 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" }]}}}}}}
205205```
206206
207207The initial ` state ` will be set as pending.
@@ -218,7 +218,7 @@ The `cs_configured_v2` table will now have a state of `active`.
218218``` bash
219219id | 1
220220state | 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" }]}}}}}}
222222```
223223
224224### Encrypting existing plaintext data
@@ -325,7 +325,7 @@ It creates an EQL payload that looks similar to this and inserts this into the e
325325 "t" : " users" , // Table
326326 "c" : " email_encrypted" // Encrypted column
327327 },
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
329329 "u" : " unique ciphertext" , // The ciphertext used for unique queries. i.e unique index
330330 "ob" : [" a" , " b" , " c" ], // The ciphertext used for order or comparison queries. i.e ore index
331331 "v" : 1
@@ -386,7 +386,7 @@ The json stored in the database looks similar to this:
386386 "t" : " users" , // Table
387387 "c" : " email_encrypted" // Encrypted column
388388 },
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
390390 "u" : " unique ciphertext" , // The ciphertext used for unique queries. i.e unique index
391391 "ob" : [" a" , " b" , " c" ], // The ciphertext used for order or comparison queries. i.e ore index
392392 "v" : 1
@@ -509,7 +509,7 @@ Prerequsites:
509509
510510- An [ ore index] ( #adding-indexes ) is needed on the encrypted column to support this operation.
511511
512- EQL function to use: ` cs_ore_64_8_v2 (val JSONB)` .
512+ EQL function to use: ` ore_block_u64_8_256 (val JSONB)` .
513513
514514A plaintext query order by email looks like this:
515515
@@ -520,7 +520,7 @@ SELECT * FROM users ORDER BY email ASC;
520520The EQL equivalent of this query is:
521521
522522``` 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 ;
524524```
525525
526526This query returns:
@@ -538,7 +538,7 @@ Prerequsites:
538538
539539- A [ unique index] ( #adding-indexes ) is needed on the encrypted column to support this operation.
540540
541- EQL function to use: ` cs_ore_64_8_v2 (val JSONB)` .
541+ EQL function to use: ` ore_block_u64_8_256 (val JSONB)` .
542542
543543EQL query payload for a comparison query:
544544
564564The EQL equivalent of this query is:
565565
566566``` 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 (
568568 ' {"v":1,"k":"pt","p":"[email protected] ","i":{"t":"users","c":"email_encrypted"},"q":"ore"}' 569569 );
570570```
0 commit comments