Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ii regexp: support multiple ".*" in one pattern
- Loading branch information
Showing
9 changed files
with
403 additions
and
47 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
60 changes: 60 additions & 0 deletions
60
test/command/suite/select/filter/index/regexp/dot_asterisk/multiple.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,60 @@ | ||
| table_create Properties TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Properties content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create RegexpTokens TABLE_PAT_KEY ShortText --normalizer NormalizerAuto --default_tokenizer TokenRegexp | ||
| [[0,0.0,0.0],true] | ||
| column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION Properties content | ||
| [[0,0.0,0.0],true] | ||
| load --table Properties | ||
| [ | ||
| {"content": "app:Groonga"}, | ||
| {"content": "app:apple"}, | ||
| {"content": "project:Groonga"}, | ||
| {"content": "appname:application1"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| log_level --level info | ||
| [[0,0.0,0.0],true] | ||
| select Properties --filter 'content @~ "app.*:.*pp.*"' --output_columns content,_score | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "app:apple", | ||
| 1 | ||
| ], | ||
| [ | ||
| "appname:application1", | ||
| 1 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| #|i| [object][search][index][key][regexp] <RegexpTokens.memos_content> | ||
| #|i| grn_ii_sel > (app.*:.*pp.*) | ||
| #|i| [ii][select][cursor][open] n=2 <app> | ||
| #|i| [ii][select][cursor][open] n=1 <:> | ||
| #|i| [ii][select][cursor][open] n=1 <pp> | ||
| #|i| exact: 2 | ||
| #|i| hits=2 | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
26 changes: 26 additions & 0 deletions
26
test/command/suite/select/filter/index/regexp/dot_asterisk/multiple.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,26 @@ | ||
| #$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes | ||
|
|
||
| table_create Properties TABLE_NO_KEY | ||
| column_create Properties content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create RegexpTokens TABLE_PAT_KEY ShortText \ | ||
| --normalizer NormalizerAuto \ | ||
| --default_tokenizer TokenRegexp | ||
| column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \ | ||
| Properties content | ||
|
|
||
| load --table Properties | ||
| [ | ||
| {"content": "app:Groonga"}, | ||
| {"content": "app:apple"}, | ||
| {"content": "project:Groonga"}, | ||
| {"content": "appname:application1"} | ||
| ] | ||
|
|
||
| log_level --level info | ||
| #@add-important-log-levels info | ||
| select Properties \ | ||
| --filter 'content @~ "app.*:.*pp.*"' \ | ||
| --output_columns content,_score | ||
| #@remove-important-log-levels info | ||
| log_level --level notice |
55 changes: 55 additions & 0 deletions
55
test/command/suite/select/filter/index/regexp/dot_asterisk/multiple_begin.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,55 @@ | ||
| table_create Properties TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Properties content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create RegexpTokens TABLE_PAT_KEY ShortText --normalizer NormalizerAuto --default_tokenizer TokenRegexp | ||
| [[0,0.0,0.0],true] | ||
| column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION Properties content | ||
| [[0,0.0,0.0],true] | ||
| load --table Properties | ||
| [ | ||
| {"content": "app:Groonga"}, | ||
| {"content": "app:apple"}, | ||
| {"content": "project:app:apple"}, | ||
| {"content": "appname:application1"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| log_level --level info | ||
| [[0,0.0,0.0],true] | ||
| select Properties --filter 'content @~ "\\\\Aapp:.*pp.*"' --output_columns content,_score | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "app:apple", | ||
| 1 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| #|i| [object][search][index][key][regexp] <RegexpTokens.memos_content> | ||
| #|i| grn_ii_sel > (\Aapp:.*pp.*) | ||
| #|i| [ii][select][cursor][open] n=3 <app:> | ||
| #|i| [ii][select][cursor][open] n=1 <pp> | ||
| #|i| exact: 1 | ||
| #|i| hits=1 | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
26 changes: 26 additions & 0 deletions
26
test/command/suite/select/filter/index/regexp/dot_asterisk/multiple_begin.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,26 @@ | ||
| #$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes | ||
|
|
||
| table_create Properties TABLE_NO_KEY | ||
| column_create Properties content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create RegexpTokens TABLE_PAT_KEY ShortText \ | ||
| --normalizer NormalizerAuto \ | ||
| --default_tokenizer TokenRegexp | ||
| column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \ | ||
| Properties content | ||
|
|
||
| load --table Properties | ||
| [ | ||
| {"content": "app:Groonga"}, | ||
| {"content": "app:apple"}, | ||
| {"content": "project:app:apple"}, | ||
| {"content": "appname:application1"} | ||
| ] | ||
|
|
||
| log_level --level info | ||
| #@add-important-log-levels info | ||
| select Properties \ | ||
| --filter 'content @~ "\\\\Aapp:.*pp.*"' \ | ||
| --output_columns content,_score | ||
| #@remove-important-log-levels info | ||
| log_level --level notice |
Oops, something went wrong.