[TEST] improve Phrase Collate filter test

This commit is contained in:
Areek Zillur 2015-05-14 18:16:03 -04:00
parent 179dad69b6
commit ac4942b5a7
1 changed files with 12 additions and 0 deletions

View File

@ -1253,6 +1253,18 @@ public class SuggestSearchTests extends ElasticsearchIntegrationTest {
assertSuggestionSize(searchSuggest, 0, 10, "title"); assertSuggestionSize(searchSuggest, 0, 10, "title");
assertSuggestionPhraseCollateMatchExists(searchSuggest, "title", 2); assertSuggestionPhraseCollateMatchExists(searchSuggest, "title", 2);
collateWithParams = XContentFactory.jsonBuilder()
.startObject()
.startObject("query")
.startObject("{{query_type}}")
.field("{{query_field}}", "{{suggestion}}")
.endObject()
.endObject()
.endObject().string();
params.clear();
params.put("query_type", "match_phrase");
params.put("query_field", "title");
// collate filter request with prune set to true // collate filter request with prune set to true
phraseSuggestWithParamsAndReturn = suggest.collateFilter(collateWithParams).collateQuery(null).collateParams(params).collatePrune(true); phraseSuggestWithParamsAndReturn = suggest.collateFilter(collateWithParams).collateQuery(null).collateParams(params).collatePrune(true);
searchSuggest = searchSuggest("united states house of representatives elections in washington 2006", phraseSuggestWithParamsAndReturn); searchSuggest = searchSuggest("united states house of representatives elections in washington 2006", phraseSuggestWithParamsAndReturn);