Kouhei Sutou
null+****@clear*****
Mon Jan 19 12:45:58 JST 2015
Kouhei Sutou 2015-01-19 12:45:58 +0900 (Mon, 19 Jan 2015) New Revision: 39e07b13cc7a8820dcb08bad084071a19c2e9173 https://github.com/groonga/groonga/commit/39e07b13cc7a8820dcb08bad084071a19c2e9173 Message: test: add more tests about match_columns with section Added files: test/command/suite/select/match_columns/section/by_index/weight.expected test/command/suite/select/match_columns/section/by_index/weight.test test/command/suite/select/match_columns/section/by_name/single.expected test/command/suite/select/match_columns/section/by_name/single.test test/command/suite/select/match_columns/section/by_name/weight.expected test/command/suite/select/match_columns/section/by_name/weight.test Added: test/command/suite/select/match_columns/section/by_index/weight.expected (+54 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_index/weight.expected 2015-01-19 12:45:58 +0900 (1e39c25) @@ -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 + ] + ] + ] +] Added: test/command/suite/select/match_columns/section/by_index/weight.test (+22 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_index/weight.test 2015-01-19 12:45:58 +0900 (3fc980a) @@ -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" Added: test/command/suite/select/match_columns/section/by_name/single.expected (+54 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_name/single.expected 2015-01-19 12:45:58 +0900 (7f73883) @@ -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 + ] + ] + ] +] Added: test/command/suite/select/match_columns/section/by_name/single.test (+22 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_name/single.test 2015-01-19 12:45:58 +0900 (0d6a7dd) @@ -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" Added: test/command/suite/select/match_columns/section/by_name/weight.expected (+54 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_name/weight.expected 2015-01-19 12:45:58 +0900 (8bf6dfc) @@ -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 + ] + ] + ] +] Added: test/command/suite/select/match_columns/section/by_name/weight.test (+22 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/match_columns/section/by_name/weight.test 2015-01-19 12:45:58 +0900 (31432c9) @@ -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" -------------- next part -------------- HTML����������������������������... 다운로드