Skip to content
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

Fix issue with adding negating scripted filter #4991

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

lukasolson
Copy link
Member

Closes #4890.

Prior to these changes, when you would use the magnifying glass buttons in discover to add a field filter on a scripted field, then again to add a negating field filter on the same field, it wasn't having any effect.

We have special logic for this situation. If a user adds a field filter, then adds a negating field filter on the same field, we can safely assume they don't actually want two conflicting field filters, so we identify the existing field filter and simply update the existing field filter and negate it.

However, the code that accomplishes this was not considering scripted fields, so it was not properly identifying that there was an existing field filter for scripted fields.

This PR fixes it so it correctly identifies when a scripted field filter on the same field already exists, and adds a test case.

@spalger spalger added the v4.2.0 label Sep 21, 2015
rashidkpc added a commit that referenced this pull request Sep 22, 2015
Fix issue with adding negating scripted filter
@rashidkpc rashidkpc merged commit ddb272f into elastic:master Sep 22, 2015
rashidkpc pushed a commit to rashidkpc/kibana that referenced this pull request Sep 22, 2015
@lukasolson lukasolson deleted the issues/4890 branch February 11, 2016 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] [Scripted Field] Clicking on the 'Filter out Value' button to reverse a filter does not work.
3 participants