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

Term filter parser too lenient #12184

Closed
spinscale opened this issue Jul 10, 2015 · 2 comments
Closed

Term filter parser too lenient #12184

spinscale opened this issue Jul 10, 2015 · 2 comments
Assignees
Labels
good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories

Comments

@spinscale
Copy link
Contributor

The term filter parser does allow specifying more than one field without barfing and throwing an exception, resulting in a last one wins scenario.

Sample to reproduce

GET /foo/bar/_search
{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "term": {
          "field2": "bar",
          "field1": "foo"
        }
      }
    }
  }
}

This should throw an exception, once field2 has been found and is tried to be overwritten.

@spinscale spinscale added good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories labels Jul 10, 2015
@clintongormley
Copy link

@javanna is this still relevant with the query refactoring branch?

@javanna
Copy link
Member

javanna commented Jul 10, 2015

yes it is still relevant, it's a fix that could be applied on master independently

spinscale added a commit to spinscale/elasticsearch that referenced this issue Jul 13, 2015
The term query parser was too lenient during parsing and allowed to specify
more than one field, even though this expected to filter only for a single field.

This commit returns an exception if a query has been specified more than once.

Closes elastic#12184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

3 participants