-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Do not respect synthetic_source_keep=arrays if type parses arrays #127796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b16fb08
43455d1
462a3cf
7399a17
187fd44
933f9e5
c0cf863
d924d2c
2ceb106
2cf5c5c
1672338
9ffebd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 127796 | ||
summary: Do not respect synthetic_source_keep=arrays if type parses arrays | ||
area: Mapping | ||
type: enhancement | ||
issues: | ||
- 126155 |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -460,7 +460,7 @@ static void parseObjectOrField(DocumentParserContext context, Mapper mapper) thr | |||
if (context.canAddIgnoredField() | ||||
&& (fieldMapper.syntheticSourceMode() == FieldMapper.SyntheticSourceMode.FALLBACK | ||||
|| sourceKeepMode == Mapper.SourceKeepMode.ALL | ||||
|| (sourceKeepMode == Mapper.SourceKeepMode.ARRAYS && context.inArrayScope()) | ||||
|| (sourceKeepMode == Mapper.SourceKeepMode.ARRAYS && context.inArrayScope() && parsesArrayValue(mapper) == false) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a correct fix in my opinion. But now that you mention offsets i actually wonder how does this work if offsets are enabled. It seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we enable offsets, parsesArrayValue will still be true for geo_point, and we won't use ignored source, right? I'm not totally sure if this is safe though. Maybe by adding offsets, geo_point will be subject to the same issue that other types have when they are in an array context. In which case we would want to use ignored_source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, i was asking about existing fields that implement offsets logic like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think existing fields with offsets do have this issue, and need to be use stored values. For example, if elasticsearch/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java Line 463 in b16fb08
The followings:
Results in:
Meaning we do need the stored source. Or is that not what you're talking about? |
||||
|| (context.isWithinCopyTo() == false && context.isCopyToDestinationField(mapper.fullPath())))) { | ||||
context = context.addIgnoredFieldFromContext( | ||||
IgnoredSourceFieldMapper.NameValue.fromContext(context, fieldMapper.fullPath(), null) | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to flip the points here to emphasize that order is different? Right now it happens to be a correct order.