#26496: Fix sporadic failure of ContextCompletionSuggestSearchIT#testGeoBoosting
This test should not rely on strict ordering for same score suggestions. The Lucene completion suggester uses the doc id in case of a tie and documents are indexed randomly.
This commit is contained in:
parent
e3b0cc9867
commit
3435c9f4e2
|
@ -502,12 +502,12 @@ public class ContextCompletionSuggestSearchIT extends ESIntegTestCase {
|
||||||
CompletionSuggestionBuilder prefix = SuggestBuilders.completionSuggestion(FIELD).prefix("sugg");
|
CompletionSuggestionBuilder prefix = SuggestBuilders.completionSuggestion(FIELD).prefix("sugg");
|
||||||
assertSuggestions("foo", prefix, "suggestion9", "suggestion8", "suggestion7", "suggestion6", "suggestion5");
|
assertSuggestions("foo", prefix, "suggestion9", "suggestion8", "suggestion7", "suggestion6", "suggestion5");
|
||||||
|
|
||||||
GeoQueryContext context1 = GeoQueryContext.builder().setGeoPoint(geoPoints[0]).setBoost(2).build();
|
GeoQueryContext context1 = GeoQueryContext.builder().setGeoPoint(geoPoints[0]).setBoost(11).build();
|
||||||
GeoQueryContext context2 = GeoQueryContext.builder().setGeoPoint(geoPoints[1]).build();
|
GeoQueryContext context2 = GeoQueryContext.builder().setGeoPoint(geoPoints[1]).build();
|
||||||
CompletionSuggestionBuilder geoBoostingPrefix = SuggestBuilders.completionSuggestion(FIELD).prefix("sugg")
|
CompletionSuggestionBuilder geoBoostingPrefix = SuggestBuilders.completionSuggestion(FIELD).prefix("sugg")
|
||||||
.contexts(Collections.singletonMap("geo", Arrays.asList(context1, context2)));
|
.contexts(Collections.singletonMap("geo", Arrays.asList(context1, context2)));
|
||||||
|
|
||||||
assertSuggestions("foo", geoBoostingPrefix, "suggestion8", "suggestion6", "suggestion4", "suggestion9", "suggestion7");
|
assertSuggestions("foo", geoBoostingPrefix, "suggestion8", "suggestion6", "suggestion4", "suggestion2", "suggestion0");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGeoPointContext() throws Exception {
|
public void testGeoPointContext() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue