-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Bug fix: Facilitate second retrieval of the same value (#134770) #134790
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
elasticsearchmachine
merged 8 commits into
elastic:main
from
gmarouli:bug-fix/unicode-parser-optimisation
Sep 17, 2025
+103
−15
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f0b206a
Bug fix: Facilitate second retrieval of the same value (#134770)
gmarouli 87f9dc9
Update docs/changelog/134790.yaml
gmarouli 8f95330
Add yaml test to capture the failing use case
gmarouli c28f30b
Merge branch 'main' into bug-fix/unicode-parser-optimisation
gmarouli 7812af6
Add test cluster feature
gmarouli 466536d
[CI] Auto commit changes from spotless
93260ec
Incorporate review feedback
gmarouli df99821
Merge branch 'main' into bug-fix/unicode-parser-optimisation
gmarouli 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: 134790 | ||
summary: "Bug fix: Facilitate second retrieval of the same value" | ||
area: Infra/Core | ||
type: bug | ||
issues: | ||
- 134770 |
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
49 changes: 49 additions & 0 deletions
49
...api-spec/src/yamlRestTest/resources/rest-api-spec/test/mapping/30_multi_field_keyword.yml
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,49 @@ | ||
--- | ||
Keyword with escaped characters as multi-field: | ||
- requires: | ||
cluster_features: [ "mapper.multi_field.unicode_optimisation_fix" ] | ||
reason: "requires a fix (#134770)" | ||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
mappings: | ||
properties: | ||
foo: | ||
type: keyword | ||
fields: | ||
bar: | ||
type: keyword | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: "1" | ||
refresh: true | ||
body: | ||
foo: "c:\\windows\\system32\\svchost.exe" | ||
|
||
- do: | ||
search: | ||
index: test | ||
body: | ||
query: | ||
term: | ||
foo: "c:\\windows\\system32\\svchost.exe" | ||
|
||
- match: { "hits.total.value": 1 } | ||
- match: | ||
hits.hits.0._source.foo: "c:\\windows\\system32\\svchost.exe" | ||
|
||
# Test that optimisation works the same for the multi-fields as well. | ||
- do: | ||
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 possible, I'd add a comment here pointing to the bug issue, so it's immediately clear why we are calling this twice (a future dev might be tempted to "clean up" things and remove the second call) |
||
search: | ||
index: test | ||
body: | ||
query: | ||
term: | ||
foo.bar: "c:\\windows\\system32\\svchost.exe" | ||
|
||
- match: { "hits.total.value": 1 } | ||
- match: | ||
hits.hits.0._source.foo: "c:\\windows\\system32\\svchost.exe" |
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
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.
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.
Would make it sense to test the reset of the lastOptimizedValue too? e.g. calling nextFieldName/nextToken + getValueAsText and ensure the content is not stale?