-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Strange behaviour of fields
API with mixed object notation
#68215
Comments
Pinging @elastic/es-search (Team:Search) |
@cbuescher have you checked the mappings for the created index? I would hope that there is one obj.products in there, in the object form. |
@javanna the mapping looks fine to me:
|
Cool, sounds like the fields API should return both values then? |
Possibly related to #65539 |
Definitely related! This is actually something that @jtibshirani called out when reviewing #65539 - I had fixed this exact case for |
Thanks @cbuescher for filing this, I forgot to open a follow-up about it after reviewing #65539.
We didn't use |
Currently, when a document source mixed json object and dotted syntax like e.g. { "foo" : { "bar" : 0 }, "foo.bar" : 1}, extracting the values from the source map via XContentMapValues#extractValue returns after the first value for a path has been found. Instead we should exhaust all possibilities and return a list of objects of we find more than one value when extending the lookup path. Closes elastic#68215
Currently, when a document source mixed json object and dotted syntax like e.g. { "foo" : { "bar" : 0 }, "foo.bar" : 1}, extracting the values from the source map via XContentMapValues#extractValue returns after the first value for a path has been found. Instead we should exhaust all possibilities and return a list of objects of we find more than one value when extending the lookup path. Closes #68215
Currently, when a document source mixed json object and dotted syntax like e.g. { "foo" : { "bar" : 0 }, "foo.bar" : 1}, extracting the values from the source map via XContentMapValues#extractValue returns after the first value for a path has been found. Instead we should exhaust all possibilities and return a list of objects of we find more than one value when extending the lookup path. Closes #68215
Currently, when a document source mixed json object and dotted syntax like e.g. { "foo" : { "bar" : 0 }, "foo.bar" : 1}, extracting the values from the source map via XContentMapValues#extractValue returns after the first value for a path has been found. Instead we should exhaust all possibilities and return a list of objects of we find more than one value when extending the lookup path. Closes #68215
It appears we can currently index and retrieve documents with mixed object notation like this:
When searching on field
obj.products.manufacturer
we get a hit for both terms "Supersoft" and "HyperSmart".However, the
fields
API output only returns second value:returns
The same output is produced when searching for "HyperSmart". Tested on 7.10.0.
The text was updated successfully, but these errors were encountered: