Kouhei Sutou
null+****@clear*****
Wed Feb 6 14:06:59 JST 2013
Kouhei Sutou 2013-02-06 14:06:59 +0900 (Wed, 06 Feb 2013) New Revision: 27b88c41b1e29daf69c28b442edf729425ad2eb4 https://github.com/groonga/groonga/commit/27b88c41b1e29daf69c28b442edf729425ad2eb4 Log: test: add a test for multi column index Added files: test/command/suite/select/index/multi_column/weight.expected test/command/suite/select/index/multi_column/weight.test Added: test/command/suite/select/index/multi_column/weight.expected (+62 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/multi_column/weight.expected 2013-02-06 14:06:59 +0900 (cec69ae) @@ -0,0 +1,62 @@ +table_create Bigram TABLE_PAT_KEY ShortText --default_tokenizer TokenBigramSplitSymbolAlpha --normalizer NormalizerAuto +[[0,0.0,0.0],true] +table_create Diaries TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Diaries title COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +column_create Diaries content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +column_create Bigram diaries COLUMN_INDEX|WITH_POSITION|WITH_SECTION Diaries title,content +[[0,0.0,0.0],true] +load --table Diaries +[ + { + "_key": "2013-02-06", + "title": "groonga", + "content": "I found groonga that is a fast fulltext search engine!" + }, + { + "_key": "2013-02-07", + "title": "mroonga", + "content": "I found mroonga that is a MySQL storage engine to use groonga!" + }, + { + "_key": "2013-02-08", + "title": "rroonga", + "content": "I found rroonga that is Ruby bindings for groonga!" + } +] +[[0,0.0,0.0],3] +select Diaries --match_columns 'Bigram.diaries * 10' --query 'engine OR mroonga' --output_columns 'title,_score' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "title", + "ShortText" + ], + [ + "_score", + "Int32" + ] + ], + [ + "groonga", + 10 + ], + [ + "mroonga", + 30 + ] + ] + ] +] Added: test/command/suite/select/index/multi_column/weight.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/multi_column/weight.test 2013-02-06 14:06:59 +0900 (43afbeb) @@ -0,0 +1,35 @@ +table_create Bigram TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenBigramSplitSymbolAlpha \ + --normalizer NormalizerAuto + +table_create Diaries TABLE_HASH_KEY ShortText +column_create Diaries title COLUMN_SCALAR ShortText +column_create Diaries content COLUMN_SCALAR Text + +column_create Bigram diaries \ + COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ + Diaries title,content + +load --table Diaries +[ + { + "_key": "2013-02-06", + "title": "groonga", + "content": "I found groonga that is a fast fulltext search engine!" + }, + { + "_key": "2013-02-07", + "title": "mroonga", + "content": "I found mroonga that is a MySQL storage engine to use groonga!" + }, + { + "_key": "2013-02-08", + "title": "rroonga", + "content": "I found rroonga that is Ruby bindings for groonga!" + } +] + +select Diaries \ + --match_columns 'Bigram.diaries * 10' \ + --query 'engine OR mroonga' \ + --output_columns 'title,_score' -------------- next part -------------- HTML����������������������������...Download