parent
f0bce08c30
commit
6469f6ef06
|
@ -561,6 +561,9 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
|||
// when the doc_values field data format is configured
|
||||
mergeContext.addConflict("mapper [" + names.fullName() + "] has different " + TypeParsers.DOC_VALUES + " values");
|
||||
}
|
||||
if (this.fieldType().omitNorms() != fieldMergeWith.fieldType.omitNorms()) {
|
||||
mergeContext.addConflict("mapper [" + names.fullName() + "] has different `norms.enabled` values");
|
||||
}
|
||||
if (this.fieldType().tokenized() != fieldMergeWith.fieldType().tokenized()) {
|
||||
mergeContext.addConflict("mapper [" + names.fullName() + "] has different tokenize values");
|
||||
}
|
||||
|
|
|
@ -182,6 +182,16 @@ public class UpdateMappingTests extends ElasticsearchIntegrationTest {
|
|||
assertThat(putMappingResponse.isAcknowledged(), equalTo(true));
|
||||
}
|
||||
|
||||
@Test(expected = MergeMappingException.class)
|
||||
public void updateMappingWithNormsConflicts() throws Exception {
|
||||
client().admin().indices().prepareCreate("test")
|
||||
.addMapping("type", "{\"type\":{\"properties\":{\"body\":{\"type\":\"string\", \"norms\": { \"enabled\": false }}}}}")
|
||||
.execute().actionGet();
|
||||
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("type")
|
||||
.setSource("{\"type\":{\"properties\":{\"body\":{\"type\":\"string\", \"norms\": { \"enabled\": true }}}}}")
|
||||
.execute().actionGet();
|
||||
}
|
||||
|
||||
/*
|
||||
First regression test for https://github.com/elasticsearch/elasticsearch/issues/3381
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue