Skip to content

Commit

Permalink
fix: _ignored_source is a multi-value field (elastic#115853)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
2 people authored and jfreden committed Nov 4, 2024
1 parent 7af97e1 commit 81b98fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,12 @@ tests:
- class: org.elasticsearch.oldrepos.OldRepositoryAccessIT
method: testOldRepoAccess
issue: https://github.com/elastic/elasticsearch/issues/115631
- class: org.elasticsearch.index.get.GetResultTests
method: testToAndFromXContent
issue: https://github.com/elastic/elasticsearch/issues/115688
- class: org.elasticsearch.action.update.UpdateResponseTests
method: testToAndFromXContent
issue: https://github.com/elastic/elasticsearch/issues/115689
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
method: testStalledShardMigrationProperlyDetected
issue: https://github.com/elastic/elasticsearch/issues/115697
- class: org.elasticsearch.index.get.GetResultTests
method: testToAndFromXContentEmbedded
issue: https://github.com/elastic/elasticsearch/issues/115657
- class: org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT
method: testGeoShapeGeoHash
issue: https://github.com/elastic/elasticsearch/issues/115664
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.index.mapper.IgnoredFieldMapper;
import org.elasticsearch.index.mapper.IgnoredSourceFieldMapper;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.SourceFieldMapper;
import org.elasticsearch.search.lookup.Source;
Expand Down Expand Up @@ -247,7 +248,7 @@ public XContentBuilder toXContentEmbedded(XContentBuilder builder, Params params

for (DocumentField field : metaFields.values()) {
// TODO: can we avoid having an exception here?
if (field.getName().equals(IgnoredFieldMapper.NAME)) {
if (field.getName().equals(IgnoredFieldMapper.NAME) || field.getName().equals(IgnoredSourceFieldMapper.NAME)) {
builder.field(field.getName(), field.getValues());
} else {
builder.field(field.getName(), field.<Object>getValue());
Expand Down Expand Up @@ -341,7 +342,7 @@ public static GetResult fromXContentEmbedded(XContentParser parser, String index
parser.skipChildren(); // skip potential inner objects for forward compatibility
}
} else if (token == XContentParser.Token.START_ARRAY) {
if (IgnoredFieldMapper.NAME.equals(currentFieldName)) {
if (IgnoredFieldMapper.NAME.equals(currentFieldName) || IgnoredSourceFieldMapper.NAME.equals(currentFieldName)) {
metaFields.put(currentFieldName, new DocumentField(currentFieldName, parser.list()));
} else {
parser.skipChildren(); // skip potential inner arrays for forward compatibility
Expand Down

0 comments on commit 81b98fb

Please sign in to comment.