Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support '-WORD' in --query of the select command
'-WORD' is disabled by default. --query_flags ALLOW_LEADING_NOT is required for the feature.
- Loading branch information
Showing
7 changed files
with
145 additions
and
0 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
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
25 changes: 25 additions & 0 deletions
25
test/function/suite/select/query/invalid/leading_not.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 | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| table_create Entries TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR Text | ||
| [[0,0.0,0.0],true] | ||
| table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Terms entries_content_index COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"_key": "The first post!", | ||
| "content": "Welcome! This is my first post!"}, | ||
| {"_key": "Groonga", | ||
| "content": "I started to use groonga. It's very fast!"}, | ||
| {"_key": "Mroonga", | ||
| "content": "I also started to use mroonga. It's also very fast! Really fast!"}, | ||
| {"_key": "Good-bye Senna", | ||
| "content": "I migrated all Senna system!"}, | ||
| {"_key": "Good-bye Tritonn", | ||
| "content": "I also migrated all Tritonn system!"} | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Entries --match_columns content --query '-fast' | ||
| [[[-63,0.0,0.0],"Syntax error! (-fast)"],[]] | ||
| #|e| Syntax error! (-fast) |
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 | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| table_create Entries TABLE_PAT_KEY ShortText | ||
| column_create Entries content COLUMN_SCALAR Text | ||
|
|
||
| table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram | ||
| column_create Terms entries_content_index COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"_key": "The first post!", | ||
| "content": "Welcome! This is my first post!"}, | ||
| {"_key": "Groonga", | ||
| "content": "I started to use groonga. It's very fast!"}, | ||
| {"_key": "Mroonga", | ||
| "content": "I also started to use mroonga. It's also very fast! Really fast!"}, | ||
| {"_key": "Good-bye Senna", | ||
| "content": "I migrated all Senna system!"}, | ||
| {"_key": "Good-bye Tritonn", | ||
| "content": "I also migrated all Tritonn system!"} | ||
| ] | ||
|
|
||
| select Entries --match_columns content --query '-fast' |
66 changes: 66 additions & 0 deletions
66
test/function/suite/select/query_flags/allow_leading_not.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 | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| table_create Entries TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR Text | ||
| [[0,0.0,0.0],true] | ||
| table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Terms entries_content_index COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"_key": "The first post!", | ||
| "content": "Welcome! This is my first post!"}, | ||
| {"_key": "Groonga", | ||
| "content": "I started to use groonga. It's very fast!"}, | ||
| {"_key": "Mroonga", | ||
| "content": "I also started to use mroonga. It's also very fast! Really fast!"}, | ||
| {"_key": "Good-bye Senna", | ||
| "content": "I migrated all Senna system!"}, | ||
| {"_key": "Good-bye Tritonn", | ||
| "content": "I also migrated all Tritonn system!"} | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Entries --match_columns content --query '-fast' --query_flags ALLOW_LEADING_NOT | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "content", | ||
| "Text" | ||
| ] | ||
| ], | ||
| [ | ||
| 4, | ||
| "Good-bye Senna", | ||
| "I migrated all Senna system!" | ||
| ], | ||
| [ | ||
| 5, | ||
| "Good-bye Tritonn", | ||
| "I also migrated all Tritonn system!" | ||
| ], | ||
| [ | ||
| 1, | ||
| "The first post!", | ||
| "Welcome! This is my first post!" | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
22 changes: 22 additions & 0 deletions
22
test/function/suite/select/query_flags/allow_leading_not.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 | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| table_create Entries TABLE_PAT_KEY ShortText | ||
| column_create Entries content COLUMN_SCALAR Text | ||
|
|
||
| table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram | ||
| column_create Terms entries_content_index COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"_key": "The first post!", | ||
| "content": "Welcome! This is my first post!"}, | ||
| {"_key": "Groonga", | ||
| "content": "I started to use groonga. It's very fast!"}, | ||
| {"_key": "Mroonga", | ||
| "content": "I also started to use mroonga. It's also very fast! Really fast!"}, | ||
| {"_key": "Good-bye Senna", | ||
| "content": "I migrated all Senna system!"}, | ||
| {"_key": "Good-bye Tritonn", | ||
| "content": "I also migrated all Tritonn system!"} | ||
| ] | ||
|
|
||
| select Entries --match_columns content --query '-fast' \ | ||
| --query_flags ALLOW_LEADING_NOT |