[TEST] Associate type with percolate query

This commit is contained in:
Martijn van Groningen 2014-08-07 23:50:23 +02:00
parent d341274457
commit e4d35c458a
1 changed files with 1 additions and 3 deletions

View File

@ -1720,14 +1720,12 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
assertMatchCount(percolateResponse, 0l);
assertThat(percolateResponse.getMatches(), arrayWithSize(0));
ensureYellow("idx");
waitForConcreteMappingsOnAll("idx", "type", "custom.color");
// The previous percolate request introduced the custom.color field, so now we register the query again
// and the field name `color` will be resolved to `custom.color` field in mapping via smart field mapping resolving.
client().prepareIndex("idx", PercolatorService.TYPE_NAME, "2")
.setSource(jsonBuilder().startObject().field("query", QueryBuilders.queryString("color:blue")).endObject())
.setSource(jsonBuilder().startObject().field("query", QueryBuilders.queryString("color:blue")).field("type", "type").endObject())
.get();
// The second request will yield a match, since the query during the proper field during parsing.