Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add more tests about match_columns with section
- Loading branch information
Showing
6 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
test/command/suite/select/match_columns/section/by_index/weight.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,54 @@ | ||
| table_create Memos TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION Memos title,content | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Memos --match_columns "Lexicon.memo_index[0] * 10" --query Ruby --output_columns "title, content, _score" | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "Ruby", | ||
| "Start Ruby!", | ||
| 10 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
22 changes: 22 additions & 0 deletions
22
test/command/suite/select/match_columns/section/by_index/weight.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 Memos TABLE_NO_KEY | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ | ||
| Memos title,content | ||
|
|
||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --match_columns "Lexicon.memo_index[0] * 10" \ | ||
| --query Ruby \ | ||
| --output_columns "title, content, _score" |
54 changes: 54 additions & 0 deletions
54
test/command/suite/select/match_columns/section/by_name/single.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,54 @@ | ||
| table_create Memos TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION Memos title,content | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Memos --match_columns "Lexicon.memo_index.title" --query Ruby --output_columns "title, content, _score" | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "Ruby", | ||
| "Start Ruby!", | ||
| 1 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
22 changes: 22 additions & 0 deletions
22
test/command/suite/select/match_columns/section/by_name/single.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 Memos TABLE_NO_KEY | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ | ||
| Memos title,content | ||
|
|
||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --match_columns "Lexicon.memo_index.title" \ | ||
| --query Ruby \ | ||
| --output_columns "title, content, _score" |
54 changes: 54 additions & 0 deletions
54
test/command/suite/select/match_columns/section/by_name/weight.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,54 @@ | ||
| table_create Memos TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION Memos title,content | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Memos --match_columns "Lexicon.memo_index.title * 10" --query Ruby --output_columns "title, content, _score" | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_score", | ||
| "Int32" | ||
| ] | ||
| ], | ||
| [ | ||
| "Ruby", | ||
| "Start Ruby!", | ||
| 10 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
22 changes: 22 additions & 0 deletions
22
test/command/suite/select/match_columns/section/by_name/weight.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 Memos TABLE_NO_KEY | ||
| column_create Memos title COLUMN_SCALAR ShortText | ||
| column_create Memos content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ | ||
| Memos title,content | ||
|
|
||
| load --table Memos | ||
| [ | ||
| ["title", "content"], | ||
| ["groonga", "Start groonga!"], | ||
| ["mroonga", "Start mroonga!"], | ||
| ["rroonga", "Start rroonga!"], | ||
| ["Ruby", "Start Ruby!"], | ||
| ["learn", "Learning Ruby and groonga..."] | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --match_columns "Lexicon.memo_index.title * 10" \ | ||
| --query Ruby \ | ||
| --output_columns "title, content, _score" |