-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] In flat_object fields null
values indexed as "null" strings
#13880
Comments
@akramarev it seems that query 4 return document is expected. I tested on the pr #7137, it doesn't return document in query 3. |
Thanks for the rely @kkewwei. It's great that your PR fixes my main concern - test case 3 (prefix query by "nu" for null field). I should spin it up and check locally as well. Regarding test case 4 (Exists query on the null field) though, I'm not sure the behavior is expected. My expectations are based on the documentation: 1. The flat object field type supports the following queries: ..., Exists So the Exists behavior that I expect from text field for example, I equally expect from flat_object fields, at least from root level json properties (e.g. record.name). Also as I mentioned elasticsearch:7.15.0 confirms my expectations. Text field example just illustrate the point above:
|
@akramarev I update my statement. In query case 3, it doesn't return document too. We don't build any index for the In query case 3, it will return doc when we set the |
@kkewwei I'm confused with case 3 and case 3 in the latest reply, could you clarify? I think you meant "In query case 3, it shouldn't return the document too". In the meantime, I pulled your branch and verified that Prefix query doesn't return the document as expected (thanks for the fix!). While Exists query still returns it, I believe it's a bug. The quickest repro with curl commands, same as before, but just a bit simpler to copy&paste in a terminal to validate.
|
@peternied I'm working on it, and almost done, please assign it to me, @akramarev, it looks more complicated than expected, there are too many cases about null value for flat_object type, I will pull separate pr to fix the null value. |
@akramarev, please try the new branch #14069 when you are free. I test two of cases ok now. |
Describe the bug
Flat_object documentation doesn't define
null
values indexing rules, though it looks unexpected that documents containing fields withnull
values can be searched withexists
or evenprefix: "nu"
queries.Related component
Indexing
To Reproduce
record.name: null
Expected behavior
Both queries 3 and 4 should return no documents, but they do return the ingested document. Tested using latest opensearchproject/opensearch:2.14.0 image.
Additional Details
Host/Environment:
Additional context
flattened
field mapping instead offlat_object
flat_object
mapping today doesn't support additional parameters ([Enhancement] Add Open Parameters to Flat_object Field Type #7137) includingnull_value
, though the currently selected default when null is treated as "null" (based on the behavior described above) doesn't look right.The text was updated successfully, but these errors were encountered: