Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test select: add tests for mix weight by index of section
first_weight: Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3] middle_mix_weight: Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] * 10 || Lexicon.memo_index[3] last_weight: Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3] * 10
- Loading branch information
Masafumi Yokoyama
committed
Mar 18, 2015
1 parent
6529fce
commit 68137e7
Showing
6 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
test/command/suite/select/match_columns/section/by_index/4_items/first_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,58 @@ | ||
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] | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
[[0,0.0,0.0],true] | ||
column_create Memos category 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,comment,category | ||
[[0,0.0,0.0],true] | ||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
[[0,0.0,0.0],5] | ||
select Memos --match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]" --query Rroonga --output_columns "title, content, _score" | ||
[ | ||
[ | ||
0, | ||
0.0, | ||
0.0 | ||
], | ||
[ | ||
[ | ||
[ | ||
1 | ||
], | ||
[ | ||
[ | ||
"title", | ||
"ShortText" | ||
], | ||
[ | ||
"content", | ||
"ShortText" | ||
], | ||
[ | ||
"_score", | ||
"Int32" | ||
] | ||
], | ||
[ | ||
"Rroonga", | ||
"Start Rroonga!", | ||
13 | ||
] | ||
] | ||
] | ||
] |
24 changes: 24 additions & 0 deletions
24
test/command/suite/select/match_columns/section/by_index/4_items/first_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,24 @@ | ||
table_create Memos TABLE_NO_KEY | ||
column_create Memos title COLUMN_SCALAR ShortText | ||
column_create Memos content COLUMN_SCALAR ShortText | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
column_create Memos category 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,comment,category | ||
|
||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
|
||
select Memos \ | ||
--match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]" \ | ||
--query Rroonga \ | ||
--output_columns "title, content, _score" |
58 changes: 58 additions & 0 deletions
58
test/command/suite/select/match_columns/section/by_index/4_items/last_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,58 @@ | ||
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] | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
[[0,0.0,0.0],true] | ||
column_create Memos category 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,comment,category | ||
[[0,0.0,0.0],true] | ||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
[[0,0.0,0.0],5] | ||
select Memos --match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]" --query Rroonga --output_columns "title, content, _score" | ||
[ | ||
[ | ||
0, | ||
0.0, | ||
0.0 | ||
], | ||
[ | ||
[ | ||
[ | ||
1 | ||
], | ||
[ | ||
[ | ||
"title", | ||
"ShortText" | ||
], | ||
[ | ||
"content", | ||
"ShortText" | ||
], | ||
[ | ||
"_score", | ||
"Int32" | ||
] | ||
], | ||
[ | ||
"Rroonga", | ||
"Start Rroonga!", | ||
13 | ||
] | ||
] | ||
] | ||
] |
24 changes: 24 additions & 0 deletions
24
test/command/suite/select/match_columns/section/by_index/4_items/last_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,24 @@ | ||
table_create Memos TABLE_NO_KEY | ||
column_create Memos title COLUMN_SCALAR ShortText | ||
column_create Memos content COLUMN_SCALAR ShortText | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
column_create Memos category 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,comment,category | ||
|
||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
|
||
select Memos \ | ||
--match_columns "Lexicon.memo_index[0] * 10 || Lexicon.memo_index[1] || Lexicon.memo_index[2] || Lexicon.memo_index[3]" \ | ||
--query Rroonga \ | ||
--output_columns "title, content, _score" |
58 changes: 58 additions & 0 deletions
58
test/command/suite/select/match_columns/section/by_index/4_items/middle_mix_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,58 @@ | ||
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] | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
[[0,0.0,0.0],true] | ||
column_create Memos category 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,comment,category | ||
[[0,0.0,0.0],true] | ||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
[[0,0.0,0.0],5] | ||
select Memos --match_columns "Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] * 10 || Lexicon.memo_index[3]" --query Rroonga --output_columns "title, content, _score" | ||
[ | ||
[ | ||
0, | ||
0.0, | ||
0.0 | ||
], | ||
[ | ||
[ | ||
[ | ||
1 | ||
], | ||
[ | ||
[ | ||
"title", | ||
"ShortText" | ||
], | ||
[ | ||
"content", | ||
"ShortText" | ||
], | ||
[ | ||
"_score", | ||
"Int32" | ||
] | ||
], | ||
[ | ||
"Rroonga", | ||
"Start Rroonga!", | ||
13 | ||
] | ||
] | ||
] | ||
] |
24 changes: 24 additions & 0 deletions
24
test/command/suite/select/match_columns/section/by_index/4_items/middle_mix_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,24 @@ | ||
table_create Memos TABLE_NO_KEY | ||
column_create Memos title COLUMN_SCALAR ShortText | ||
column_create Memos content COLUMN_SCALAR ShortText | ||
column_create Memos comment COLUMN_SCALAR ShortText | ||
column_create Memos category 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,comment,category | ||
|
||
load --table Memos | ||
[ | ||
["title", "content", "comment", "category"], | ||
["Groonga", "Start Groonga!", "Groonga!", "Groonga"], | ||
["Mroonga", "Start Mroonga!", "Mroonga!", "Mroonga"], | ||
["Rroonga", "Start Rroonga!", "Rroonga!", "Rroonga"], | ||
["Ruby", "Start Ruby!", "Ruby!", "Ruby"], | ||
["learn", "Learning Ruby and Groonga...", "learn!", "learn"] | ||
] | ||
|
||
select Memos \ | ||
--match_columns "Lexicon.memo_index[0] || Lexicon.memo_index[1] || Lexicon.memo_index[2] * 10 || Lexicon.memo_index[3]" \ | ||
--query Rroonga \ | ||
--output_columns "title, content, _score" |