-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Regression in 8.6.0: Not returning empty arrays when source filtering inside them #109668
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
Comments
Pinging @elastic/es-search (Team:Search) |
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
It looks like this change in behaviour was caused by #91127. |
+1 to this we rely on the old behavior in all of our clients quite heavily and it would be a huge undertaking to build compatibility. Is this something that can be prioritized for a fix? @elasticsearchmachine |
Fixes elastic#109668. This fixes the specific case outlined in the above linked Github issue - namely this: * Document: `{ "myArray": [] }` * Source filter: `myArray.myField` * Expected filtered result: `{ "myArray": [] }` * Actual filtered result: `{}` When we switched to from map-based source filtering to Jackson-streaming-based source filtering in some code paths as part of filtering (using the automata, etc.) correctly included the empty array from the parent. Unfortunately, it's not clear when these two code paths for source filtering diverge in behavior. Note also the long comment in `FilterPathBasedFilter`. It's not clear what the correct behavior is when we are filtering out all contents of arrays via source filter path exclusion.
This fixes the specific case outlined in the above linked Github issue - namely this: Document: { "myArray": [] } Source filter: myArray.myField Expected filtered result: { "myArray": [] } Actual filtered result: {} This broke when we switched to from map-based source filtering to Jackson-streaming-based source filtering in some code paths - see elastic#91127. Map-based source filtering (using the automata, etc.) correctly included the empty array from the parent. Unfortunately, it's not clear when these two code paths for source filtering diverge in behavior. Note also the long comment in FilterPathBasedFilter. It's not clear what the correct behavior is when we are filtering out all contents of arrays via source filter path exclusion.
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
re-tagged based on the tags in #112250 |
Elasticsearch Version
from 8.6.0 until current
Installed Plugins
No response
Java Version
openjdk version "19.0.1" 2022-10-18
OS Version
Linux e3b996519639 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC
Problem Description
Exclude filtering causes empty objects from the response to disappear entirely.
This is probably very similar to these.
#29622
#23796
But the thing is that this WAS working fine in 8.3.x, 8.4.x, 8.5.x, ...
8.6.0 broke this feature again.
Steps to Reproduce
setup data
search
result
It should contain "myArray" with empty arrays.
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: