|
21 | 21 | import org.elasticsearch.common.logging.DeprecationLogger; |
22 | 22 | import org.elasticsearch.common.xcontent.XContentHelper; |
23 | 23 | import org.elasticsearch.index.mapper.IgnoredFieldMapper; |
| 24 | +import org.elasticsearch.index.mapper.IgnoredSourceFieldMapper; |
24 | 25 | import org.elasticsearch.index.mapper.MapperService; |
25 | 26 | import org.elasticsearch.index.mapper.SourceFieldMapper; |
26 | 27 | import org.elasticsearch.search.lookup.Source; |
@@ -247,7 +248,7 @@ public XContentBuilder toXContentEmbedded(XContentBuilder builder, Params params |
247 | 248 |
|
248 | 249 | for (DocumentField field : metaFields.values()) { |
249 | 250 | // 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)) { |
251 | 252 | builder.field(field.getName(), field.getValues()); |
252 | 253 | } else { |
253 | 254 | builder.field(field.getName(), field.<Object>getValue()); |
@@ -341,7 +342,7 @@ public static GetResult fromXContentEmbedded(XContentParser parser, String index |
341 | 342 | parser.skipChildren(); // skip potential inner objects for forward compatibility |
342 | 343 | } |
343 | 344 | } else if (token == XContentParser.Token.START_ARRAY) { |
344 | | - if (IgnoredFieldMapper.NAME.equals(currentFieldName)) { |
| 345 | + if (IgnoredFieldMapper.NAME.equals(currentFieldName) || IgnoredSourceFieldMapper.NAME.equals(currentFieldName)) { |
345 | 346 | metaFields.put(currentFieldName, new DocumentField(currentFieldName, parser.list())); |
346 | 347 | } else { |
347 | 348 | parser.skipChildren(); // skip potential inner arrays for forward compatibility |
|
0 commit comments