Skip to content

Commit eeea953

Browse files
committed
updates
1 parent aba471e commit eeea953

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public int get() {
111111
private final Set<String> ignoredFields;
112112
private final List<IgnoredSourceFieldMapper.NameValue> ignoredFieldValues;
113113
private final List<IgnoredSourceFieldMapper.NameValue> ignoredFieldsMissingValues;
114+
private final boolean inArrayScopeEnabled;
114115
private boolean inArrayScope;
115116

116117
private final Map<String, List<Mapper>> dynamicMappers;
@@ -143,6 +144,7 @@ private DocumentParserContext(
143144
Set<String> ignoreFields,
144145
List<IgnoredSourceFieldMapper.NameValue> ignoredFieldValues,
145146
List<IgnoredSourceFieldMapper.NameValue> ignoredFieldsWithNoSource,
147+
boolean inArrayScopeEnabled,
146148
boolean inArrayScope,
147149
Map<String, List<Mapper>> dynamicMappers,
148150
Map<String, ObjectMapper> dynamicObjectMappers,
@@ -164,6 +166,7 @@ private DocumentParserContext(
164166
this.ignoredFields = ignoreFields;
165167
this.ignoredFieldValues = ignoredFieldValues;
166168
this.ignoredFieldsMissingValues = ignoredFieldsWithNoSource;
169+
this.inArrayScopeEnabled = inArrayScopeEnabled;
167170
this.inArrayScope = inArrayScope;
168171
this.dynamicMappers = dynamicMappers;
169172
this.dynamicObjectMappers = dynamicObjectMappers;
@@ -188,6 +191,7 @@ private DocumentParserContext(ObjectMapper parent, ObjectMapper.Dynamic dynamic,
188191
in.ignoredFields,
189192
in.ignoredFieldValues,
190193
in.ignoredFieldsMissingValues,
194+
in.inArrayScopeEnabled,
191195
in.inArrayScope,
192196
in.dynamicMappers,
193197
in.dynamicObjectMappers,
@@ -219,6 +223,7 @@ protected DocumentParserContext(
219223
new HashSet<>(),
220224
new ArrayList<>(),
221225
new ArrayList<>(),
226+
mappingParserContext.getIndexSettings().isSyntheticSourceSecondDocParsingPassEnabled(),
222227
false,
223228
new HashMap<>(),
224229
new HashMap<>(),
@@ -371,7 +376,7 @@ public final Collection<IgnoredSourceFieldMapper.NameValue> getIgnoredFieldsMiss
371376
* Applies to synthetic source only.
372377
*/
373378
public final DocumentParserContext maybeCloneForArray(Mapper mapper) throws IOException {
374-
if (canAddIgnoredField() && mapper instanceof ObjectMapper && indexSettings().isSyntheticSourceSecondDocParsingPassEnabled()) {
379+
if (canAddIgnoredField() && mapper instanceof ObjectMapper && inArrayScopeEnabled) {
375380
boolean isNested = mapper instanceof NestedObjectMapper;
376381
if ((inArrayScope == false && isNested == false) || (inArrayScope && isNested)) {
377382
DocumentParserContext subcontext = switchParser(parser());

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/TransportResumeFollowActionTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ public void testDynamicIndexSettingsAreClassified() {
332332
replicatedSettings.add(IndexSettings.MAX_SHINGLE_DIFF_SETTING);
333333
replicatedSettings.add(IndexSettings.TIME_SERIES_END_TIME);
334334
replicatedSettings.add(IndexSettings.PREFER_ILM_SETTING);
335+
replicatedSettings.add(IndexSettings.SYNTHETIC_SOURCE_SECOND_DOC_PARSING_PASS_SETTING);
335336
replicatedSettings.add(IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_READ_SETTING);
336337
replicatedSettings.add(IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_WRITE_SETTING);
337338

0 commit comments

Comments
 (0)