Skip to content

Commit 19e8ffe

Browse files
fix: _ignored_source is a multi-value field
1 parent f395f11 commit 19e8ffe

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,12 @@ tests:
251251
- class: org.elasticsearch.oldrepos.OldRepositoryAccessIT
252252
method: testOldRepoAccess
253253
issue: https://github.com/elastic/elasticsearch/issues/115631
254-
- class: org.elasticsearch.index.get.GetResultTests
255-
method: testToAndFromXContent
256-
issue: https://github.com/elastic/elasticsearch/issues/115688
257254
- class: org.elasticsearch.action.update.UpdateResponseTests
258255
method: testToAndFromXContent
259256
issue: https://github.com/elastic/elasticsearch/issues/115689
260257
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
261258
method: testStalledShardMigrationProperlyDetected
262259
issue: https://github.com/elastic/elasticsearch/issues/115697
263-
- class: org.elasticsearch.index.get.GetResultTests
264-
method: testToAndFromXContentEmbedded
265-
issue: https://github.com/elastic/elasticsearch/issues/115657
266260
- class: org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT
267261
method: testGeoShapeGeoHash
268262
issue: https://github.com/elastic/elasticsearch/issues/115664

server/src/main/java/org/elasticsearch/index/get/GetResult.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.common.logging.DeprecationLogger;
2222
import org.elasticsearch.common.xcontent.XContentHelper;
2323
import org.elasticsearch.index.mapper.IgnoredFieldMapper;
24+
import org.elasticsearch.index.mapper.IgnoredSourceFieldMapper;
2425
import org.elasticsearch.index.mapper.MapperService;
2526
import org.elasticsearch.index.mapper.SourceFieldMapper;
2627
import org.elasticsearch.search.lookup.Source;
@@ -247,7 +248,7 @@ public XContentBuilder toXContentEmbedded(XContentBuilder builder, Params params
247248

248249
for (DocumentField field : metaFields.values()) {
249250
// TODO: can we avoid having an exception here?
250-
if (field.getName().equals(IgnoredFieldMapper.NAME)) {
251+
if (field.getName().equals(IgnoredFieldMapper.NAME) || field.getName().equals(IgnoredSourceFieldMapper.NAME)) {
251252
builder.field(field.getName(), field.getValues());
252253
} else {
253254
builder.field(field.getName(), field.<Object>getValue());
@@ -341,7 +342,7 @@ public static GetResult fromXContentEmbedded(XContentParser parser, String index
341342
parser.skipChildren(); // skip potential inner objects for forward compatibility
342343
}
343344
} else if (token == XContentParser.Token.START_ARRAY) {
344-
if (IgnoredFieldMapper.NAME.equals(currentFieldName)) {
345+
if (IgnoredFieldMapper.NAME.equals(currentFieldName) || IgnoredSourceFieldMapper.NAME.equals(currentFieldName)) {
345346
metaFields.put(currentFieldName, new DocumentField(currentFieldName, parser.list()));
346347
} else {
347348
parser.skipChildren(); // skip potential inner arrays for forward compatibility

0 commit comments

Comments
 (0)