Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
column_create: add more validations
1: Full text search index for vector column must have WITH_SECTION flag. 2: Full text search index for vector column must not be multi column index. The following command returns nothing: plugin_register functions/index_column table_create Docs TABLE_HASH_KEY ShortText column_create Docs sentences1 COLUMN_VECTOR Text column_create Docs sentences2 COLUMN_VECTOR Text table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram column_create Words docs_sentences COLUMN_INDEX|WITH_POSITION|WITH_SECTION Docs sentences1,sentences2 load --table Docs [ {"_key": "x", "sentences1": ["-", "-", "-"], "sentences2": ["-", "-", "-"]} ] load --table Docs [ {"_key": "x", "sentences1": []} ] select Words \ --limit -1 \ --sort_keys _key \ --output_columns '_key, index_column_source_records("docs_sentences")' index_column_source_records() output: [ [ 0, 0.0, 0.0 ], [ [ [ 1 ], [ [ "_key", "ShortText" ], [ "index_column_source_records", null ] ], [ "-", [ ] ] ] ] ] The second load removes posting lists for Docs.sentences2 unexpectedly. We can remove the 2nd validation when we support the update case.
- Loading branch information
Showing
9 changed files
with
93 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/command/suite/column_create/index/source/multi_column/vector_full_text_search.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
plugin_register functions/index_column | |||
[[0,0.0,0.0],true] | |||
table_create Docs TABLE_NO_KEY | |||
[[0,0.0,0.0],true] | |||
column_create Docs title COLUMN_SCALAR ShortText | |||
[[0,0.0,0.0],true] | |||
column_create Docs sentences COLUMN_VECTOR Text | |||
[[0,0.0,0.0],true] | |||
table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | |||
[[0,0.0,0.0],true] | |||
column_create Words docs_content COLUMN_INDEX|WITH_SECTION|WITH_POSITION Docs title,sentences | |||
[ | |||
[ | |||
[ | |||
-22, | |||
0.0, | |||
0.0 | |||
], | |||
"grn_obj_set_info(): GRN_INFO_SOURCE: multi column full text index with vector column isn't supported yet: <Words.docs_content>" | |||
], | |||
false | |||
] | |||
#|e| grn_obj_set_info(): GRN_INFO_SOURCE: multi column full text index with vector column isn't supported yet: <Words.docs_content> |
9 changes: 9 additions & 0 deletions
9
test/command/suite/column_create/index/source/multi_column/vector_full_text_search.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
plugin_register functions/index_column | |||
|
|||
table_create Docs TABLE_NO_KEY | |||
column_create Docs title COLUMN_SCALAR ShortText | |||
column_create Docs sentences COLUMN_VECTOR Text | |||
|
|||
table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | |||
column_create Words docs_content \ | |||
COLUMN_INDEX|WITH_SECTION|WITH_POSITION Docs title,sentences |
10 changes: 10 additions & 0 deletions
10
test/command/suite/column_create/index/source/vector_column/full_text_search.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
plugin_register functions/index_column | |||
[[0,0.0,0.0],true] | |||
table_create Docs TABLE_NO_KEY | |||
[[0,0.0,0.0],true] | |||
column_create Docs sentences COLUMN_VECTOR Text | |||
[[0,0.0,0.0],true] | |||
table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | |||
[[0,0.0,0.0],true] | |||
column_create Words docs_sentences COLUMN_INDEX|WITH_SECTION|WITH_POSITION Docs sentences | |||
[[0,0.0,0.0],true] |
7 changes: 7 additions & 0 deletions
7
test/command/suite/column_create/index/source/vector_column/full_text_search.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
plugin_register functions/index_column | |||
|
|||
table_create Docs TABLE_NO_KEY | |||
column_create Docs sentences COLUMN_VECTOR Text | |||
|
|||
table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | |||
column_create Words docs_sentences COLUMN_INDEX|WITH_SECTION|WITH_POSITION Docs sentences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
test/command/suite/load/index/online/vector/text_without_section.expected
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
test/command/suite/load/index/online/vector/text_without_section.test
This file was deleted.
Oops, something went wrong.