Kouhei Sutou
null+****@clear*****
Thu Sep 25 20:50:00 JST 2014
Kouhei Sutou 2014-09-25 20:50:00 +0900 (Thu, 25 Sep 2014) New Revision: 455b22a6e150ba4e5075974644a99c37e4c42083 https://github.com/groonga/groonga/commit/455b22a6e150ba4e5075974644a99c37e4c42083 Message: test command: add a test for prefix search by asterisk Added files: test/command/suite/select/query/asterisk/prefix_search.expected test/command/suite/select/query/asterisk/prefix_search.test Added: test/command/suite/select/query/asterisk/prefix_search.expected (+59 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/asterisk/prefix_search.expected 2014-09-25 20:50:00 +0900 (6d8fef8) @@ -0,0 +1,59 @@ +table_create Diaries TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Diaries content COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto +[[0,0.0,0.0],true] +column_create Terms diaries_content COLUMN_INDEX|WITH_POSITION Diaries content +[[0,0.0,0.0],true] +load --table Diaries +[ +{"content": "It'll be fine tomorrow as well."}, +{"content": "It'll rain tomorrow."}, +{"content": "It's fine today. It'll be fine tomorrow as well."}, +{"content": "It's fine today. But it'll rain tomorrow."}, +{"content": "Ring the bell."}, +{"content": "I love dumbbells."} +] +[[0,0.0,0.0],6] +select --table Diaries --match_columns content --query "to*" --output_columns content,_score --sortby _id +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 4 + ], + [ + [ + "content", + "ShortText" + ], + [ + "_score", + "Int32" + ] + ], + [ + "It'll be fine tomorrow as well.", + 1 + ], + [ + "It'll rain tomorrow.", + 1 + ], + [ + "It's fine today. It'll be fine tomorrow as well.", + 2 + ], + [ + "It's fine today. But it'll rain tomorrow.", + 2 + ] + ] + ] +] Added: test/command/suite/select/query/asterisk/prefix_search.test (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/asterisk/prefix_search.test 2014-09-25 20:50:00 +0900 (9ebfebb) @@ -0,0 +1,24 @@ +table_create Diaries TABLE_NO_KEY +column_create Diaries content COLUMN_SCALAR ShortText + +table_create Terms TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenBigram \ + --normalizer NormalizerAuto +column_create Terms diaries_content COLUMN_INDEX|WITH_POSITION Diaries content + +load --table Diaries +[ +{"content": "It'll be fine tomorrow as well."}, +{"content": "It'll rain tomorrow."}, +{"content": "It's fine today. It'll be fine tomorrow as well."}, +{"content": "It's fine today. But it'll rain tomorrow."}, +{"content": "Ring the bell."}, +{"content": "I love dumbbells."} +] + +select \ + --table Diaries \ + --match_columns content \ + --query "to*" \ + --output_columns content,_score \ + --sortby _id -------------- next part -------------- HTML����������������������������... ダウンロード