Explicitly set mappings in SearchAfterIT (#54262)
We have some very occasional failures in SearchAfterIT, where a search throws an exception because a shard does not have the mapping for the requested sort field. The field should have been added in a dynamic mapping update after an index event, but it seems that there can sometimes be a small delay in propagating this update to the shards. This commit changes the test to explicitly define the relevant field at index creation time. Fixes #51900
This commit is contained in:
parent
d8f745736b
commit
048797389a
|
@ -51,7 +51,7 @@ public class SearchAfterIT extends ESIntegTestCase {
|
|||
|
||||
public void testsShouldFail() throws Exception {
|
||||
assertAcked(client().admin().indices().prepareCreate("test")
|
||||
.addMapping("type1", "field2", "type=keyword")
|
||||
.addMapping("type1", "field1", "type=long", "field2", "type=keyword")
|
||||
.get()
|
||||
);
|
||||
ensureGreen();
|
||||
|
|
Loading…
Reference in New Issue