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
This commit is contained in:
Areek Zillur 2015-04-07 18:36:35 +00:00
parent 614bf6ac23
commit 1780ea3488
1 changed files with 5 additions and 3 deletions

View File

@ -325,9 +325,11 @@ public class SuggestFieldTest extends LuceneTestCase {
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);