Sets update_all_types when setting mapping (#13991)

Prior to 5.6, we would push mappings once the object type was used. Since we are now ensuring all mappings are set, there is a situation where a field with type string exists but we are pushing text.

You can not have a field with the same name, but different data type, in two different document types.

To resolve this, we are setting update_all_types when updating mappings.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2017-09-14 11:21:12 -07:00 committed by GitHub
parent cf8d97f389
commit d1e7b4cfb0

View file

@ -55,13 +55,15 @@ export async function ensureTypesExist({ log, indexName, callCluster, types }) {
properties: {
[type.name]: type.mapping
}
}
},
update_all_types: true
});
} else {
await callCluster('indices.putMapping', {
index: indexName,
type: type.name,
body: type.mapping
body: type.mapping,
update_all_types: true
});
}
}