From ba798b0e88538b4d4d7aede71025cce1b982a3e4 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 19 Nov 2025 16:44:32 +0100 Subject: [PATCH 01/13] Fix StoredFieldsSpec#merge(...) issue If StoredFieldsSpec requires source and has no sourcePaths, then it requires the whole source. For example, in case of `SourceFieldBlockLoader`. When merging StoredFieldsSpec then omit the sourcePaths of the other StoredFieldsSpec. Closes #138188 --- .../search/fetch/StoredFieldsSpec.java | 12 +++++-- .../rest-api-spec/test/esql/140_metadata.yml | 32 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java index f5eee3d8d5502..fcf5d474a8184 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java @@ -82,9 +82,17 @@ public StoredFieldsSpec merge(StoredFieldsSpec other) { mergedSourcePaths = new HashSet<>(this.sourcePaths); mergedSourcePaths.addAll(other.sourcePaths); } else if (this.sourcePaths.isEmpty() == false) { - mergedSourcePaths = this.sourcePaths; + if (other.requiresSource) { + mergedSourcePaths = Set.of(); + } else { + mergedSourcePaths = this.sourcePaths; + } } else if (other.sourcePaths.isEmpty() == false) { - mergedSourcePaths = other.sourcePaths; + if (this.requiresSource) { + mergedSourcePaths = Set.of(); + } else { + mergedSourcePaths = other.sourcePaths; + } } else { mergedSourcePaths = Set.of(); } diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index 35cfbac5e3439..0a4c86c92d1fd 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -210,3 +210,35 @@ setup: "keyword" : "ok", "case" : "ok" }} + +--- +"source meta field and dynamic false": + - do: + indices.create: + index: my-index2 + body: + mappings: + dynamic: false + properties: + foo: + type: text + + - do: + bulk: + index: my-index2 + refresh: true + body: + - { "index": { } } + - { "baz": "dasd" } + - do: + esql.query: + body: + query: 'FROM my-test METADATA _source' + + - match: {columns.0.name: "foo"} + - match: {columns.0.type: "text"} + - match: {columns.1.name: "_source"} + - match: {columns.1.type: "_source"} + + - match: {values.0.0: null + - match: {values.0.1: { "baz": "dasd" } From fbd008630690989752d8a1ce28c7519eae8387a3 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 19 Nov 2025 17:58:21 +0100 Subject: [PATCH 02/13] fix yaml test --- .../resources/rest-api-spec/test/esql/140_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index 0a4c86c92d1fd..c0b3ac0bcffd1 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -240,5 +240,5 @@ setup: - match: {columns.1.name: "_source"} - match: {columns.1.type: "_source"} - - match: {values.0.0: null + - match: {values.0.0: null} - match: {values.0.1: { "baz": "dasd" } From 840a0d12fc003002f6f05b6b7901efc658a0841f Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 19 Nov 2025 17:58:37 +0100 Subject: [PATCH 03/13] fix yaml test 2 --- .../resources/rest-api-spec/test/esql/140_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index c0b3ac0bcffd1..9b906d956a015 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -241,4 +241,4 @@ setup: - match: {columns.1.type: "_source"} - match: {values.0.0: null} - - match: {values.0.1: { "baz": "dasd" } + - match: {values.0.1: { "baz": "dasd" }} From d912b090495bca873b4341941a558481a2c4b6d4 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 20 Nov 2025 10:10:04 +0100 Subject: [PATCH 04/13] fix yaml test 3 --- .../resources/rest-api-spec/test/esql/140_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index 9b906d956a015..46e3f6a3378f5 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -233,7 +233,7 @@ setup: - do: esql.query: body: - query: 'FROM my-test METADATA _source' + query: 'FROM my-index2 METADATA _source' - match: {columns.0.name: "foo"} - match: {columns.0.type: "text"} From 6fc551c95c80c513f117ea7b2a0c2962e6c7fde2 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 20 Nov 2025 10:43:41 +0100 Subject: [PATCH 05/13] adjust unit test --- .../search/fetch/StoredFieldsSpecTests.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java index 7c66d91ac7a0a..90bc8e3ac5553 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java @@ -120,7 +120,7 @@ public void testMergeSourcePaths() { spec = spec.merge( new StoredFieldsSpec( - true, + false, false, Set.of("other_field"), IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, @@ -133,6 +133,22 @@ public void testMergeSourcePaths() { assertThat(spec.requiredStoredFields(), containsInAnyOrder("other_field")); assertThat(spec.sourcePaths(), containsInAnyOrder("cat", "dog", "hamster")); assertThat(spec.sourcePaths(), sameInstance(pref)); + + // Clears source paths, because the spec requires complete source (since no source paths are defined) + spec = spec.merge( + new StoredFieldsSpec( + true, + false, + Set.of(), + IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, + Set.of() + ) + ); + assertThat(spec.ignoredSourceFormat(), equalTo(IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE)); + assertThat(spec.requiresSource(), equalTo(true)); + assertThat(spec.requiresMetadata(), equalTo(false)); + assertThat(spec.requiredStoredFields(), containsInAnyOrder("other_field")); + assertThat(spec.sourcePaths(), empty()); } private static SearchContext searchContext(SearchSourceBuilder sourceBuilder) { From ed3dbc3bb69bb1a14b62088db58ccb24c6cfead9 Mon Sep 17 00:00:00 2001 From: elasticsearchmachine Date: Thu, 20 Nov 2025 09:52:54 +0000 Subject: [PATCH 06/13] [CI] Auto commit changes from spotless --- .../elasticsearch/search/fetch/StoredFieldsSpecTests.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java index 90bc8e3ac5553..d322e552d8899 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java @@ -136,13 +136,7 @@ public void testMergeSourcePaths() { // Clears source paths, because the spec requires complete source (since no source paths are defined) spec = spec.merge( - new StoredFieldsSpec( - true, - false, - Set.of(), - IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, - Set.of() - ) + new StoredFieldsSpec(true, false, Set.of(), IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, Set.of()) ); assertThat(spec.ignoredSourceFormat(), equalTo(IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE)); assertThat(spec.requiresSource(), equalTo(true)); From 471a415ff5579a4ba2dca641d9b35ab66a846f8b Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 20 Nov 2025 11:35:39 +0100 Subject: [PATCH 07/13] added LIMIT 10 to avoid warning, doesn't change the test. --- .../resources/rest-api-spec/test/esql/140_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index 46e3f6a3378f5..a681c3cca01a7 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -233,7 +233,7 @@ setup: - do: esql.query: body: - query: 'FROM my-index2 METADATA _source' + query: 'FROM my-index2 METADATA _source LIMIT 10' - match: {columns.0.name: "foo"} - match: {columns.0.type: "text"} From 94b779fe485d039b79a7a54b5c548458fe5281a1 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 20 Nov 2025 12:02:14 +0100 Subject: [PATCH 08/13] fix query --- .../resources/rest-api-spec/test/esql/140_metadata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index a681c3cca01a7..e8aab61ddb6f3 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -233,7 +233,7 @@ setup: - do: esql.query: body: - query: 'FROM my-index2 METADATA _source LIMIT 10' + query: 'FROM my-index2 METADATA _source | LIMIT 10' - match: {columns.0.name: "foo"} - match: {columns.0.type: "text"} From ad75759d22bb9667f587e073ff443e9b6e94c394 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 24 Nov 2025 09:55:25 +0100 Subject: [PATCH 09/13] iter unit test --- .../search/fetch/StoredFieldsSpecTests.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java index d322e552d8899..ef6bce827a98e 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/StoredFieldsSpecTests.java @@ -120,7 +120,7 @@ public void testMergeSourcePaths() { spec = spec.merge( new StoredFieldsSpec( - false, + false, // if set to true, then the new spec will require complete and source and so source paths would then be empty false, Set.of("other_field"), IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, @@ -133,15 +133,23 @@ public void testMergeSourcePaths() { assertThat(spec.requiredStoredFields(), containsInAnyOrder("other_field")); assertThat(spec.sourcePaths(), containsInAnyOrder("cat", "dog", "hamster")); assertThat(spec.sourcePaths(), sameInstance(pref)); + } - // Clears source paths, because the spec requires complete source (since no source paths are defined) - spec = spec.merge( - new StoredFieldsSpec(true, false, Set.of(), IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE, Set.of()) - ); - assertThat(spec.ignoredSourceFormat(), equalTo(IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE)); + public void testMergeSourcePathsRequireCompleteSource() { + var ignoredSourceFormat = IgnoredSourceFieldMapper.IgnoredSourceFormat.NO_IGNORED_SOURCE; + StoredFieldsSpec spec = new StoredFieldsSpec(true, false, Set.of(), ignoredSourceFormat, Set.of("field1", "field2")); + assertThat(spec.ignoredSourceFormat(), equalTo(ignoredSourceFormat)); assertThat(spec.requiresSource(), equalTo(true)); assertThat(spec.requiresMetadata(), equalTo(false)); - assertThat(spec.requiredStoredFields(), containsInAnyOrder("other_field")); + assertThat(spec.requiredStoredFields(), empty()); + assertThat(spec.sourcePaths(), containsInAnyOrder("field1", "field2")); + + // Clears source paths, because this spec requires complete source (since no source paths are defined) + spec = spec.merge(new StoredFieldsSpec(true, false, Set.of(), ignoredSourceFormat, Set.of())); + assertThat(spec.ignoredSourceFormat(), equalTo(ignoredSourceFormat)); + assertThat(spec.requiresSource(), equalTo(true)); + assertThat(spec.requiresMetadata(), equalTo(false)); + assertThat(spec.requiredStoredFields(), empty()); assertThat(spec.sourcePaths(), empty()); } From 099e61ad6d1e2cc36dab96b02ffc038c819d1026 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 24 Nov 2025 10:01:47 +0100 Subject: [PATCH 10/13] added node feature --- .../java/org/elasticsearch/index/mapper/MapperFeatures.java | 4 +++- .../resources/rest-api-spec/test/esql/140_metadata.yml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java b/server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java index ae40e8d1c696a..7b96b1b7cc835 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java @@ -64,6 +64,7 @@ public class MapperFeatures implements FeatureSpecification { public static final NodeFeature GENERIC_VECTOR_FORMAT = new NodeFeature("mapper.vectors.generic_vector_format"); public static final NodeFeature FIX_DENSE_VECTOR_WRONG_FIELDS = new NodeFeature("mapper.fix_dense_vector_wrong_fields"); static final NodeFeature BBQ_DISK_STATS_SUPPORT = new NodeFeature("mapper.bbq_disk_stats_support"); + static final NodeFeature STORED_FIELDS_SPEC_MERGE_BUG = new NodeFeature("mapper.stored_fields_spec_merge_bug"); @Override public Set getTestFeatures() { @@ -108,7 +109,8 @@ public Set getTestFeatures() { EXCLUDE_VECTORS_DOCVALUE_BUGFIX, BASE64_DENSE_VECTORS, FIX_DENSE_VECTOR_WRONG_FIELDS, - BBQ_DISK_STATS_SUPPORT + BBQ_DISK_STATS_SUPPORT, + STORED_FIELDS_SPEC_MERGE_BUG ); if (ES93GenericFlatVectorsFormat.GENERIC_VECTOR_FORMAT.isEnabled()) { features = new HashSet<>(features); diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index e8aab61ddb6f3..6e70fb330a2fa 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -213,6 +213,9 @@ setup: --- "source meta field and dynamic false": + - requires: + cluster_features: [ "mapper.stored_fields_spec_merge_bug" ] + reason: "Test can only run on clusters with the bug fix" - do: indices.create: index: my-index2 From ed012a3992e5389214ca0eb0b2392efa7fd0097a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 24 Nov 2025 11:54:24 +0100 Subject: [PATCH 11/13] extract merging source paths to a private helper method --- .../search/fetch/StoredFieldsSpec.java | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java index fcf5d474a8184..77cae1c112adc 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java @@ -77,25 +77,7 @@ public StoredFieldsSpec merge(StoredFieldsSpec other) { mergedFields = new HashSet<>(this.requiredStoredFields); mergedFields.addAll(other.requiredStoredFields); } - Set mergedSourcePaths; - if (this.sourcePaths.isEmpty() == false && other.sourcePaths.isEmpty() == false) { - mergedSourcePaths = new HashSet<>(this.sourcePaths); - mergedSourcePaths.addAll(other.sourcePaths); - } else if (this.sourcePaths.isEmpty() == false) { - if (other.requiresSource) { - mergedSourcePaths = Set.of(); - } else { - mergedSourcePaths = this.sourcePaths; - } - } else if (other.sourcePaths.isEmpty() == false) { - if (this.requiresSource) { - mergedSourcePaths = Set.of(); - } else { - mergedSourcePaths = other.sourcePaths; - } - } else { - mergedSourcePaths = Set.of(); - } + Set mergedSourcePaths = mergeSourcePaths(other); IgnoredSourceFormat mergedFormat; if (this.ignoredSourceFormat == IgnoredSourceFormat.NO_IGNORED_SOURCE) { mergedFormat = other.ignoredSourceFormat; @@ -122,6 +104,29 @@ public StoredFieldsSpec merge(StoredFieldsSpec other) { ); } + private Set mergeSourcePaths(StoredFieldsSpec other) { + Set mergedSourcePaths; + if (this.sourcePaths.isEmpty() == false && other.sourcePaths.isEmpty() == false) { + mergedSourcePaths = new HashSet<>(this.sourcePaths); + mergedSourcePaths.addAll(other.sourcePaths); + } else if (this.sourcePaths.isEmpty() == false) { + if (other.requiresSource) { + mergedSourcePaths = Set.of(); + } else { + mergedSourcePaths = this.sourcePaths; + } + } else if (other.sourcePaths.isEmpty() == false) { + if (this.requiresSource) { + mergedSourcePaths = Set.of(); + } else { + mergedSourcePaths = other.sourcePaths; + } + } else { + mergedSourcePaths = Set.of(); + } + return mergedSourcePaths; + } + public Set requiredStoredFields() { if (sourcePaths.isEmpty() || ignoredSourceFormat == IgnoredSourceFormat.NO_IGNORED_SOURCE) { return requiredStoredFields; From 356c6a8d626eb38e8dc036dd06dc9c5ce3f00fa6 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 24 Nov 2025 12:17:09 +0100 Subject: [PATCH 12/13] Add a test that shows that the problem isn't inherent to dynamic set to false (which wouldn't map a field), but to stored field spec merging. --- .../rest-api-spec/test/esql/140_metadata.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml index 6e70fb330a2fa..309db96c9c984 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/140_metadata.yml @@ -245,3 +245,38 @@ setup: - match: {values.0.0: null} - match: {values.0.1: { "baz": "dasd" }} + +--- +"source meta field and keep": + - requires: + cluster_features: [ "mapper.stored_fields_spec_merge_bug" ] + reason: "Test can only run on clusters with the bug fix" + - do: + indices.create: + index: my-index2 + body: + mappings: + properties: + foo: + type: text + + - do: + bulk: + index: my-index2 + refresh: true + body: + - { "index": { } } + - { "baz": "dasd" } + - do: + esql.query: + body: + query: 'FROM my-index2 METADATA _source | KEEP foo, _source | LIMIT 10' + + - match: {columns.0.name: "foo"} + - match: {columns.0.type: "text"} + - match: {columns.1.name: "_source"} + - match: {columns.1.type: "_source"} + + - match: {values.0.0: null} + - match: {values.0.1: { "baz": "dasd" }} + From 867051a2edd256bb11970a11db6fb471e6726588 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 25 Nov 2025 18:17:27 +0100 Subject: [PATCH 13/13] added jdocs --- .../java/org/elasticsearch/search/fetch/StoredFieldsSpec.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java index 77cae1c112adc..c66615f490ff3 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsSpec.java @@ -104,6 +104,10 @@ public StoredFieldsSpec merge(StoredFieldsSpec other) { ); } + /** + * Returns the unique source paths that should be loaded from source. Other source paths may be filtered out. + * If an empty set is returned, then all source paths need to be loaded. + */ private Set mergeSourcePaths(StoredFieldsSpec other) { Set mergedSourcePaths; if (this.sourcePaths.isEmpty() == false && other.sourcePaths.isEmpty() == false) {