mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
[TEST] Associate type with percolate query
This commit is contained in:
parent
d341274457
commit
e4d35c458a
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user