The include in parent parameter can t be updated on a nested object mapping – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.9-8.9

Briefly, this error occurs when an attempt is made to update the [include_in_parent] parameter on a nested object mapping in Elasticsearch. This parameter is immutable once set and cannot be changed. To resolve this issue, you can either recreate the index with the desired settings or create a new index with the correct settings and reindex the data from the old index to the new one.

This guide will help you check for common problems that cause the log ” the [include_in_parent] parameter can’t be updated on a nested object mapping ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: mapping, index.

Log Context

Log “the [include_in_parent] parameter can’t be updated on a nested object mapping” class name is NestedObjectMapper.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (mergeWithObject.includeInRoot.explicit()) {
 toMerge.includeInRoot = mergeWithObject.includeInRoot;
 }
 } else {
 if (includeInParent.value() != mergeWithObject.includeInParent.value()) {
 throw new MapperException("the [include_in_parent] parameter can't be updated on a nested object mapping");
 }
 if (includeInRoot.value() != mergeWithObject.includeInRoot.value()) {
 throw new MapperException("the [include_in_root] parameter can't be updated on a nested object mapping");
 }
 }

 

 [ratemypost]