-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
Merged
parkertimmins
merged 12 commits into
elastic:main
from
parkertimmins:parkertimmins/synthetic-source-geo-point-arrays
May 9, 2025
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b16fb08
Dont store geo_point in ignored source
parkertimmins 43455d1
Simplify tests
parkertimmins 462a3cf
Update docs/changelog/127795.yaml
parkertimmins 7399a17
Merge branch 'main' into parkertimmins/synthetic-source-geo-point-arrays
parkertimmins 187fd44
Update docs/changelog/127796.yaml
parkertimmins 933f9e5
Remove changelog from old PR
parkertimmins c0cf863
Update docs/changelog/127796.yaml
parkertimmins d924d2c
update docs
parkertimmins 2ceb106
Merge branch 'main' into parkertimmins/synthetic-source-geo-point-arrays
parkertimmins 2cf5c5c
Docs should use type specific synthetic_source_keep
parkertimmins 1672338
Update docs/reference/elasticsearch/mapping-reference/geo-point.md
parkertimmins 9ffebd2
Swap point order to highlight ordering not preserved
parkertimmins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
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
(sourceKeepMode == Mapper.SourceKeepMode.ARRAYS && context.inArrayScope()
is true and we'll proceed with storing the value in ignored source. But that seems wrong since we should be using offsets?Uh oh!
There was an error while loading. Please reload this page.
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Right, i was asking about existing fields that implement offsets logic like
ip
. Does it not have the same problem?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.
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?