diff --git a/server/src/main/java/org/elasticsearch/index/IndexSettings.java b/server/src/main/java/org/elasticsearch/index/IndexSettings.java index 86dec0d5f2857..386256886e66a 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexSettings.java +++ b/server/src/main/java/org/elasticsearch/index/IndexSettings.java @@ -1690,8 +1690,7 @@ public boolean isRecoverySourceEnabled() { * @return Whether recovery source should always be bypassed in favor of using synthetic source. */ public boolean isRecoverySourceSyntheticEnabled() { - return version.onOrAfter(IndexVersions.USE_SYNTHETIC_SOURCE_FOR_RECOVERY) - && recoverySourceSyntheticEnabled; + return version.onOrAfter(IndexVersions.USE_SYNTHETIC_SOURCE_FOR_RECOVERY) && recoverySourceSyntheticEnabled; } /** diff --git a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java index 1b1716d5285f4..e835faae96f66 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java @@ -3157,7 +3157,7 @@ public Translog.Snapshot newChangesSnapshot( try { final Translog.Snapshot snapshot; if (engineConfig.getMapperService().mappingLookup().isSourceSynthetic() - && engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) { + && engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) { snapshot = new LuceneSyntheticSourceChangesSnapshot( engineConfig.getMapperService().mappingLookup(), searcher, diff --git a/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java index 5a5d896f0a457..3120211769ae8 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java @@ -411,9 +411,7 @@ public void testRecoverySourceWithSyntheticSource() throws IOException { assertThat(doc.rootDoc().getField("_recovery_source").binaryValue(), equalTo(new BytesRef("{\"field1\":\"value1\"}"))); } { - Settings settings = Settings.builder() - .put(IndexSettings.RECOVERY_SOURCE_SYNTHETIC_ENABLED_SETTING.getKey(), true) - .build(); + Settings settings = Settings.builder().put(IndexSettings.RECOVERY_SOURCE_SYNTHETIC_ENABLED_SETTING.getKey(), true).build(); MapperService mapperService = createMapperService( settings, topMapping(b -> b.startObject(SourceFieldMapper.NAME).field("mode", "synthetic").endObject()) diff --git a/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java index a24988dee086d..3d8fd0ff86fbc 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java @@ -1361,7 +1361,7 @@ public static void assertConsistentHistoryBetweenTranslogAndLuceneIndex(Engine e assertThat(luceneOp.opType(), equalTo(translogOp.opType())); if (luceneOp.opType() == Translog.Operation.Type.INDEX) { if (engine.engineConfig.getMapperService().mappingLookup().isSourceSynthetic() - && engine.engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) { + && engine.engineConfig.getIndexSettings().isRecoverySourceSyntheticEnabled()) { assertToXContentEquivalent( ((Translog.Index) luceneOp).source(), ((Translog.Index) translogOp).source(),