Skip to content

Commit

Permalink
Added testcase for similar() - verifying the input works
Browse files Browse the repository at this point in the history
  • Loading branch information
romanchyla committed Aug 25, 2019
1 parent e64214b commit 9347ad7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@ public void testSpecialCases() throws Exception {
assertQueryEquals(req("defType", "aqp", "q", "similar(foo bar baz, input)"),
"like:foo bar baz",
MoreLikeThisQuery.class);
// default docfreq=2, termfreq=2
assertQ(req("q", "similar(foo bar baz, input, 100, 100, 2, 2)"),
"//*[@numFound='0']");
// change defaults
assertQ(req("q", "similar(foo bar baz, input, 100, 100, 1, 1)"),
"//*[@numFound='1']",
"//doc/str[@name='id'][.='2']");

assertQueryEquals(req("defType", "aqp", "q", "similar(recid:2, title)"),
"+like:title bitle -BitSetQuery(1)",
BooleanQuery.class);
Expand Down

0 comments on commit 9347ad7

Please sign in to comment.