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

Fixes Filter and FiltersAggregation to work with empty query #17542

Merged
merged 1 commit into from
Apr 5, 2016
Merged

Fixes Filter and FiltersAggregation to work with empty query #17542

merged 1 commit into from
Apr 5, 2016

Conversation

colings86
Copy link
Contributor

This fix ensures the filter and filters aggregation will not throw a NPE when {} is passed in as a filter. Instead {} is interpreted as a MatchAllDocsQuery.

Closes #17518

@javanna
Copy link
Member

javanna commented Apr 5, 2016

LGTM

…query

This fix ensures the filter and filters aggregation will not throw a NPE when `{}` is passed in as a filter. Instead `{}` is interpreted as a MatchAllDocsQuery.

Closes #17518
@colings86 colings86 merged commit 65a5366 into elastic:master Apr 5, 2016
@colings86 colings86 deleted the fix/17518 branch April 5, 2016 16:21
@Mpdreamz
Copy link
Member

This might be a feature not a bug but 6.0.0-alpha1 started throwing on this again:

{
  "aggs": {
    "empty_filter": {
      "filter": {}
    }
  }
}
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "query malformed, empty clause found at [4:18]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "query malformed, empty clause found at [4:18]"
  },
  "status" : 400
}

@javanna
Copy link
Member

javanna commented May 12, 2017

@Mpdreamz it is indeed a feature :) See #22092 . Support for empty queries was deprecated in 5.0 and removed in 6.0.

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.

Filter aggregation with no filter results in a NullPointerException
3 participants