Kouhei Sutou
null+****@clear*****
Tue Feb 13 18:14:31 JST 2018
Kouhei Sutou 2018-02-13 18:14:31 +0900 (Tue, 13 Feb 2018) New Revision: a4f6c0abc91dd0db11d1dc04c527e2e2875a0d97 https://github.com/groonga/groonga/commit/a4f6c0abc91dd0db11d1dc04c527e2e2875a0d97 Message: test: add missing quorum match tests Added files: test/command/suite/select/query/quorum_match/default.expected test/command/suite/select/query/quorum_match/default.test test/command/suite/select/query/quorum_match/score_func.expected test/command/suite/select/query/quorum_match/score_func.test test/command/suite/select/query/quorum_match/threshold.expected test/command/suite/select/query/quorum_match/threshold.test test/command/suite/select/query/quorum_match/weight.expected test/command/suite/select/query/quorum_match/weight.test Added: test/command/suite/select/query/quorum_match/default.expected (+53 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/default.expected 2018-02-13 18:14:31 +0900 (c7b686a8e) @@ -0,0 +1,53 @@ +table_create Paragraphs TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Paragraphs content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit --normalizer NormalizerAuto +[[0,0.0,0.0],true] +column_create Words index COLUMN_INDEX Paragraphs content +[[0,0.0,0.0],true] +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] +[[0,0.0,0.0],4] +select Paragraphs --match_columns content --query '*Q"search engine MySQL"' --output_columns content,_score +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 3 + ], + [ + [ + "content", + "Text" + ], + [ + "_score", + "Int32" + ] + ], + [ + "Groonga is a full text search engine", + 2 + ], + [ + "PGroonga is an full text search extension for PostgreSQL", + 1 + ], + [ + "Mroonga is a MySQL storage engine", + 2 + ] + ] + ] +] Added: test/command/suite/select/query/quorum_match/default.test (+20 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/default.test 2018-02-13 18:14:31 +0900 (b3fc0b0cd) @@ -0,0 +1,20 @@ +table_create Paragraphs TABLE_NO_KEY +column_create Paragraphs content COLUMN_SCALAR Text + +table_create Words TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenDelimit \ + --normalizer NormalizerAuto +column_create Words index COLUMN_INDEX Paragraphs content + +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] + +select Paragraphs \ + --match_columns content \ + --query '*Q"search engine MySQL"' \ + --output_columns content,_score Added: test/command/suite/select/query/quorum_match/score_func.expected (+49 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/score_func.expected 2018-02-13 18:14:31 +0900 (032d40e83) @@ -0,0 +1,49 @@ +table_create Paragraphs TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Paragraphs content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit --normalizer NormalizerAuto +[[0,0.0,0.0],true] +column_create Words index COLUMN_INDEX Paragraphs content +[[0,0.0,0.0],true] +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] +[[0,0.0,0.0],4] +select Paragraphs --match_columns 'scorer_tf_at_most(content, 2) * 2' --query '*Q3"full text search engine MySQL"' --output_columns content,_score +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "content", + "Text" + ], + [ + "_score", + "Int32" + ] + ], + [ + "Groonga is a full text search engine", + 4 + ], + [ + "PGroonga is an full text search extension for PostgreSQL", + 4 + ] + ] + ] +] Added: test/command/suite/select/query/quorum_match/score_func.test (+20 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/score_func.test 2018-02-13 18:14:31 +0900 (21b656b49) @@ -0,0 +1,20 @@ +table_create Paragraphs TABLE_NO_KEY +column_create Paragraphs content COLUMN_SCALAR Text + +table_create Words TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenDelimit \ + --normalizer NormalizerAuto +column_create Words index COLUMN_INDEX Paragraphs content + +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] + +select Paragraphs \ + --match_columns 'scorer_tf_at_most(content, 2) * 2' \ + --query '*Q3"full text search engine MySQL"' \ + --output_columns content,_score Added: test/command/suite/select/query/quorum_match/threshold.expected (+49 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/threshold.expected 2018-02-13 18:14:31 +0900 (4115efaa2) @@ -0,0 +1,49 @@ +table_create Paragraphs TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Paragraphs content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit --normalizer NormalizerAuto +[[0,0.0,0.0],true] +column_create Words index COLUMN_INDEX Paragraphs content +[[0,0.0,0.0],true] +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] +[[0,0.0,0.0],4] +select Paragraphs --match_columns content --query '*Q2"search engine MySQL"' --output_columns content,_score +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "content", + "Text" + ], + [ + "_score", + "Int32" + ] + ], + [ + "Groonga is a full text search engine", + 2 + ], + [ + "Mroonga is a MySQL storage engine", + 2 + ] + ] + ] +] Added: test/command/suite/select/query/quorum_match/threshold.test (+20 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/threshold.test 2018-02-13 18:14:31 +0900 (0f5c22aa7) @@ -0,0 +1,20 @@ +table_create Paragraphs TABLE_NO_KEY +column_create Paragraphs content COLUMN_SCALAR Text + +table_create Words TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenDelimit \ + --normalizer NormalizerAuto +column_create Words index COLUMN_INDEX Paragraphs content + +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] + +select Paragraphs \ + --match_columns content \ + --query '*Q2"search engine MySQL"' \ + --output_columns content,_score Added: test/command/suite/select/query/quorum_match/weight.expected (+53 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/weight.expected 2018-02-13 18:14:31 +0900 (65131ea00) @@ -0,0 +1,53 @@ +table_create Paragraphs TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Paragraphs content COLUMN_SCALAR Text +[[0,0.0,0.0],true] +table_create Words TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit --normalizer NormalizerAuto +[[0,0.0,0.0],true] +column_create Words index COLUMN_INDEX Paragraphs content +[[0,0.0,0.0],true] +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] +[[0,0.0,0.0],4] +select Paragraphs --match_columns 'content * 2' --query '*Q"search engine MySQL"' --output_columns content,_score +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 3 + ], + [ + [ + "content", + "Text" + ], + [ + "_score", + "Int32" + ] + ], + [ + "Groonga is a full text search engine", + 4 + ], + [ + "PGroonga is an full text search extension for PostgreSQL", + 2 + ], + [ + "Mroonga is a MySQL storage engine", + 4 + ] + ] + ] +] Added: test/command/suite/select/query/quorum_match/weight.test (+20 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/quorum_match/weight.test 2018-02-13 18:14:31 +0900 (f2c480c7b) @@ -0,0 +1,20 @@ +table_create Paragraphs TABLE_NO_KEY +column_create Paragraphs content COLUMN_SCALAR Text + +table_create Words TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenDelimit \ + --normalizer NormalizerAuto +column_create Words index COLUMN_INDEX Paragraphs content + +load --table Paragraphs +[ +{"content": "Groonga is a full text search engine"}, +{"content": "Mroonga is a MySQL storage engine"}, +{"content": "PGroonga is an full text search extension for PostgreSQL"}, +{"content": "Rroonga is a Ruby bindings of GroongaL"} +] + +select Paragraphs \ + --match_columns 'content * 2' \ + --query '*Q"search engine MySQL"' \ + --output_columns content,_score -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180213/2dc9b793/attachment-0001.htm