-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fixes #4047 - Empty objects are not stored in _source when an include/ex... #4080
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
Conversation
…include/exclude list is present
Hi, Once again - thx for looking into this. I don't think we should make a distinction between having an So with this object, I think this is what it should do:
Then
Also,
while
and for your example, with the following object:
A mapping with
Makes sense? |
…include/exclude list is present
@bleskes I believe this will take care of the use case you outlined. |
Thanks @RobCherry , will look at it asap. |
} | ||
} | ||
if (excluded) { | ||
if (Regex.simpleMatch(excludes, path)) { |
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.
nice!
Hi, Left some comments. Thanks again for looking into this, I know it can be very tricky to get it right. Also the extra tests are a great addition. Cheers, |
Hi Rob, Sorry for not looking at this. I was travelling the whole of last week. Back now and will pick it asap. |
Great. Let me know what you think about #4080 (comment) |
Hi Rob, I thought about this some more and I do think you have a point. However, that will be a bigger change and it will break backwards compatibility. I think suggest we do this in small steps - first solve the bug you've found and then open another issue to discuss the general behavior and wether we want to change it (with the next major version which is 1.0). If you agree, here is my idea for solving the bug: let's change the internal filter function ( https://github.com/elasticsearch/elasticsearch/pull/4080/files#diff-85c60dcb441d2ac9b132d73b9b6d2bbbR143 ) to return a bool indicating whether it actually filtered something away. Then we can use the old code, but only skip empty objects if the recursive call actually filtered something. Note that this can happen if some elements did not match an include rule or if one element matched an exclude rule. |
I have opened #4491. |
Hi Rob, Do you still want on fixing this issue, while we resolve the discussion about the more general approach? |
I don't have time to work on this right now, it may be a few weeks before I can circle back. If it is still open when I get time to work on it I would be happy to make the recommended changes. |
closing this one as well, as the issue is resolved: #4047 |
Adds initial very minimal support for geo_shapes to SQL. For now, geoshapes are converted into String instead of Geometry objects on the JDBC side and no effort to parse the result is performed. Relates #4080
...clude list is present
Closes #4047
This was originally being tracked by pull request #4048. I closed that pull request because it was sloppy.
I am uncertain about the behavior for handling includes/excludes with empty objects and wildcards, so I added tests to cover the following cases, but please let me know if you think the results are incorrect...
Given
And a mapping
Results in a filtered source of
However, if given
and the same mapping, the filtered source would be