Kouhei Sutou
null+****@clear*****
Thu Sep 25 21:28:42 JST 2014
Kouhei Sutou 2014-09-25 21:28:42 +0900 (Thu, 25 Sep 2014) New Revision: 92406947ed2ab11bd2682db42ebff920b6b631b1 https://github.com/groonga/groonga/commit/92406947ed2ab11bd2682db42ebff920b6b631b1 Message: test command: add a test for similar search Added files: test/command/suite/select/query/similar_search/default.expected test/command/suite/select/query/similar_search/default.test Added: test/command/suite/select/query/similar_search/default.expected (+42 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/similar_search/default.expected 2014-09-25 21:28:42 +0900 (64e52f0) @@ -0,0 +1,42 @@ +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": "a a a b b c d e f g h i j k"} +] +[[0,0.0,0.0],1] +select --table Diaries --match_columns content --query '*S"a b c"' --output_columns content,_score --sortby _id +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 1 + ], + [ + [ + "content", + "ShortText" + ], + [ + "_score", + "Int32" + ] + ], + [ + "a a a b b c d e f g h i j k", + 1048577 + ] + ] + ] +] Added: test/command/suite/select/query/similar_search/default.test (+19 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/similar_search/default.test 2014-09-25 21:28:42 +0900 (c7ae828) @@ -0,0 +1,19 @@ +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": "a a a b b c d e f g h i j k"} +] + +select \ + --table Diaries \ + --match_columns content \ + --query '*S"a b c"' \ + --output_columns content,_score \ + --sortby _id -------------- next part -------------- HTML����������������������������... Download