-
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
Changes from 3 commits
f0b206a
87f9dc9
8f95330
c28f30b
7812af6
466536d
93260ec
df99821
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: 134790 | ||
summary: "Bug fix: Facilitate second retrieval of the same value" | ||
area: Infra/Core | ||
type: bug | ||
issues: | ||
- 134770 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,10 @@ public void testGetValueAsText() throws IOException { | |
var text = parser.getValueAsText(); | ||
assertThat(text, Matchers.notNullValue()); | ||
assertTextRef(text.bytes(), "bar\"baz\""); | ||
// Retrieve the value for a second time to ensure the last value is available | ||
text = parser.getValueAsText(); | ||
assertThat(text, Matchers.notNullValue()); | ||
assertTextRef(text.bytes(), "bar\"baz\""); | ||
gmarouli marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
}); | ||
|
||
testParseJson("{\"foo\": \"b\\u00e5r\"}", parser -> { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
Keyword with escaped characters as multi-field: | ||
- 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" | ||
|
||
- 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" |
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?