[TEST] Removed the restriction on the number of bool clauses that must 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.
This commit is contained in:
parent
7847ec0a6c
commit
d8bb7c157a
|
@ -276,15 +276,19 @@ public class MoreLikeThisActionTests extends ElasticsearchIntegrationTest {
|
|||
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue