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 matches case
- Loading branch information
Showing
3 changed files
with
93 additions
and
2 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
62 changes: 62 additions & 0 deletions
62
test/command/suite/select/filter/index/regexp/dot_asterisk/n_matches.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,62 @@ | ||
| table_create Memos TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos content COLUMN_SCALAR Text | ||
| [[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 Memos content | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"content": "Groonga Groonga"}, | ||
| {"content": "Groonga Rroonga"}, | ||
| {"content": "PGroonga PostgreSQL"} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| log_level --level info | ||
| [[0,0.0,0.0],true] | ||
| select Memos --filter 'content @~ "g.*ga"' --output_columns content,_score | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "content", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga Groonga", | ||
| 3 | ||
| ], | ||
| [ | ||
| "Groonga Rroonga", | ||
| 2 | ||
| ], | ||
| [ | ||
| "PGroonga PostgreSQL", | ||
| 1 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| #|i| [object][search][index][key][regexp] <RegexpTokens.memos_content> | ||
| #|i| grn_ii_sel > (g.*ga) | ||
| #|i| [ii][select][cursor][open] n=1 <g> | ||
| #|i| [ii][select][cursor][open] n=1 <ga> | ||
| #|i| exact: 3 | ||
| #|i| hits=3 | ||
| log_level --level notice | ||
| [[0,0.0,0.0],true] |
25 changes: 25 additions & 0 deletions
25
test/command/suite/select/filter/index/regexp/dot_asterisk/n_matches.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,25 @@ | ||
| #$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes | ||
|
|
||
| table_create Memos TABLE_NO_KEY | ||
| column_create Memos content COLUMN_SCALAR Text | ||
|
|
||
| table_create RegexpTokens TABLE_PAT_KEY ShortText \ | ||
| --normalizer NormalizerAuto \ | ||
| --default_tokenizer TokenRegexp | ||
| column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \ | ||
| Memos content | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"content": "Groonga Groonga"}, | ||
| {"content": "Groonga Rroonga"}, | ||
| {"content": "PGroonga PostgreSQL"} | ||
| ] | ||
|
|
||
| log_level --level info | ||
| #@add-important-log-levels info | ||
| select Memos \ | ||
| --filter 'content @~ "g.*ga"' \ | ||
| --output_columns content,_score | ||
| #@remove-important-log-levels info | ||
| log_level --level notice |