Skip to content

Commit 3a92281

Browse files
committed
add prefixes to jsonb index
1 parent e54dc41 commit 3a92281

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

languages/go/xorm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Example:
190190
SELECT cs_add_index_v1('examples', 'encrypted_text_field', 'unique', 'text', '{"token_filters": [{"kind": "downcase"}]}');
191191
SELECT cs_add_index_v1('examples', 'encrypted_text_field', 'match', 'text');
192192
SELECT cs_add_index_v1('examples', 'encrypted_text_field', 'ore', 'text');
193-
SELECT cs_add_index_v1('examples', 'encrypted_jsonb_field', 'ste_vec', 'jsonb', '{"prefix": "some-prefix"}');
193+
SELECT cs_add_index_v1('examples', 'encrypted_jsonb_field', 'ste_vec', 'jsonb', '{"prefix": "examples/encrypted_jsonb_field"}');
194194

195195
-- The below indexes will also need to be added to enable full search functionality on the encrypted columns
196196

languages/go/xorm/migrations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ func AddIndexes(engine *sql.DB) {
6161
SELECT cs_add_index_v1('examples', 'encrypted_text_field', 'match', 'text');
6262
SELECT cs_add_index_v1('examples', 'encrypted_text_field', 'ore', 'text');
6363
SELECT cs_add_index_v1('examples', 'encrypted_int_field', 'ore', 'int');
64-
SELECT cs_add_index_v1('examples', 'encrypted_jsonb_field', 'ste_vec', 'jsonb', '{"prefix": "some-prefix"}');
64+
SELECT cs_add_index_v1('examples', 'encrypted_jsonb_field', 'ste_vec', 'jsonb', '{"prefix": "examples/encrypted_jsonb_field"}');
6565
SELECT cs_add_index_v1('examples', 'encrypted_bool_field', 'ore', 'boolean');
6666
6767
CREATE UNIQUE INDEX ON examples(cs_unique_v1(encrypted_text_field));
6868
CREATE INDEX ON examples USING GIN (cs_match_v1(encrypted_text_field));
6969
CREATE INDEX ON examples (cs_ore_64_8_v1(encrypted_text_field));
70-
CREATE INDEX ON examples USING GIN (cs_ste_vec_v1(encrypted_jsonb_field));
70+
-- CREATE INDEX ON examples USING GIN (cs_ste_vec_v1(encrypted_jsonb_field));
7171
CREATE INDEX ON examples (cs_ore_64_8_v1(encrypted_int_field));
7272
CREATE INDEX ON examples (cs_ore_64_8_v1(encrypted_bool_field));
7373

0 commit comments

Comments
 (0)