Skip to content

Commit

Permalink
[TEST] Removed the restriction on the number of bool clauses that mus…
Browse files Browse the repository at this point in the history
…t match.

The test failed because 'percent_terms_to_match' defaults to 0.3, which results
in requiring that some terms only found in the queried document must match, when
all the documents are on the same shard.
  • Loading branch information
alexksikes committed May 9, 2014
1 parent 7847ec0 commit d8bb7c1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/test/java/org/elasticsearch/mlt/MoreLikeThisActionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,19 @@ public void testSimpleMoreLikeInclude() throws Exception {

logger.info("Running More Like This with include true");
SearchResponse mltResponse = client().moreLikeThis(
moreLikeThisRequest("test").type("type1").id("1").minTermFreq(1).minDocFreq(1).include(true)).actionGet();
moreLikeThisRequest("test").type("type1").id("1").minTermFreq(1).minDocFreq(1).include(true).percentTermsToMatch(0))
.actionGet();
assertOrderedSearchHits(mltResponse, "1", "2");

mltResponse = client().moreLikeThis(
moreLikeThisRequest("test").type("type1").id("2").minTermFreq(1).minDocFreq(1).include(true)).actionGet();
moreLikeThisRequest("test").type("type1").id("2").minTermFreq(1).minDocFreq(1).include(true).percentTermsToMatch(0))
.actionGet();
assertOrderedSearchHits(mltResponse, "2", "1");

logger.info("Running More Like This with include false");
mltResponse = client().moreLikeThis(moreLikeThisRequest("test").type("type1").id("1").minTermFreq(1).minDocFreq(1)).actionGet();
mltResponse = client().moreLikeThis(
moreLikeThisRequest("test").type("type1").id("1").minTermFreq(1).minDocFreq(1).percentTermsToMatch(0))
.actionGet();
assertSearchHits(mltResponse, "2");
}

Expand Down

0 comments on commit d8bb7c1

Please sign in to comment.