Hi,
We are trying to migrate from 5.5.2. to 6.8.12 version.Below is the sample of my mapping. I have set my mapping to dynamic:strict and only one object I would want to introduce dynamically so setting it to true. This worked fine 5.5.2 but in 6.8.12 I am getting the below error. Can some one please help how to proceed.
Error:
[ElasticsearchException[Elasticsearch exception [type=strict_dynamic_mapping_exception, reason=mapping set to strict, dynamic introduction of [5bd6fa70-0412-11eb-a292-8aa14da452bd] within [_doc] is not allowed]]]
Mapping:
We insert using BulkProcessor JAVA API and use RESTHttpClient(http://localhost:9200)
Map<String, Object> map = new HashMap<>();|
map.putAll("attributes1");-->other fields in schema
map.putAll("attributes");---> this is the attribute lcoation with dynamic true
esBulkProcessor.processRequest(new UpdateRequest(index,_doc,key).doc(map).upsert( new IndexRequest(index).id(key).source(map)));
@SuppressWarnings("rawtypes")
public synchronized void processRequest(DocWriteRequest request) {
bulkProcessor .add(request);
}
Let me know if you need anything. Thanks for the response.
this is the log file
in bulkadd update {[indexname][_doc][keyname], doc_as_upsert[false], doc[index {[null][null][null], source[{“name”:”Ben”,”5bd6fa70-0412-11eb-a292-8aa14da452bd":"test123"}]}], upsert[index {[indexname][null][keyname], source[{“name”:”Ben”,”5bd6fa70-0412-11eb-a292-8aa14da452bd":"test123","StaticGroupAssignment":"true","esLastUpdateTime":"1601576338394"}]}], scripted_upsert[false], detect_noop[true]}
[0]: index [indexname], type [_doc], id [keyname], message [ElasticsearchException[Elasticsearch exception [type=strict_dynamic_mapping_exception, reason=mapping set to strict, dynamic introduction of [5bd6fa70-0412-11eb-a292-8aa14da452bd] within [_doc] is not allowed]]]
Thank you Alexander. I was able to fix this issue. They way we were updating the dynamic attributes had an issue. Fixed that. Thanks for your suggestions
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.