Navigation Menu

Skip to content

Commit

Permalink
test: add missing quorum match tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 13, 2018
1 parent 08e7520 commit a4f6c0a
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 0 deletions.
53 changes: 53 additions & 0 deletions test/command/suite/select/query/quorum_match/default.expected
@@ -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
]
]
]
]
20 changes: 20 additions & 0 deletions test/command/suite/select/query/quorum_match/default.test
@@ -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
49 changes: 49 additions & 0 deletions test/command/suite/select/query/quorum_match/score_func.expected
@@ -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
]
]
]
]
20 changes: 20 additions & 0 deletions test/command/suite/select/query/quorum_match/score_func.test
@@ -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
49 changes: 49 additions & 0 deletions test/command/suite/select/query/quorum_match/threshold.expected
@@ -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
]
]
]
]
20 changes: 20 additions & 0 deletions test/command/suite/select/query/quorum_match/threshold.test
@@ -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
53 changes: 53 additions & 0 deletions test/command/suite/select/query/quorum_match/weight.expected
@@ -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
]
]
]
]
20 changes: 20 additions & 0 deletions test/command/suite/select/query/quorum_match/weight.test
@@ -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

0 comments on commit a4f6c0a

Please sign in to comment.