Permalink
Browse files

LUCENE-6339: fix test (take into account inadmissible filtered search…

… for multiple segments)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1671914 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
areek committed Apr 7, 2015
1 parent 5159033 commit 43c674588c92b955483cc51352acacf92e8516aa
@@ -325,9 +325,11 @@ public void testSuggestOnMostlyFilteredOutDocuments() throws Exception {
QueryWrapperFilter filterWrapper = new QueryWrapperFilter(NumericRangeQuery.newIntRange("filter_int_fld", 0, topScore, true, true));
Filter filter = randomAccessFilter(filterWrapper);
// if at most half of the top scoring documents have been filtered out
// the search should be admissible
TopSuggestDocs suggest = indexSearcher.suggest("suggest_field", "abc_", 1, filter);
assertSuggestions(suggest, new Entry("abc_" + topScore, topScore));
// the search should be admissible for a single segment
TopSuggestDocs suggest = indexSearcher.suggest("suggest_field", "abc_", num, filter);
assertTrue(suggest.totalHits >= 1);
assertThat(suggest.scoreLookupDocs()[0].key.toString(), equalTo("abc_" + topScore));
assertThat(suggest.scoreLookupDocs()[0].score, equalTo((float) topScore));
filterWrapper = new QueryWrapperFilter(NumericRangeQuery.newIntRange("filter_int_fld", 0, 0, true, true));
filter = randomAccessFilter(filterWrapper);

0 comments on commit 43c6745

Please sign in to comment.