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

Query DSL: Add filter clauses to bool queries. #11142

Merged
merged 1 commit into from May 13, 2015

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented May 13, 2015

These clauses filter the document space without affecting scoring and map to
Lucene's BooleanClause.Occur.FILTER. The filtered query is now deprecated and

{
  "filtered": {
    "query": { //query },
    "filter": { //filter }
  }
}

should be replaced with

{
  "bool": {
    "must": { //query },
    "filter": { //filter }
  }
}

These clauses filter the document space without affecting scoring and map to
Lucene's BooleanClause.Occur.FILTER. The `filtered` query is now deprecated and

```json
{
  "filtered": {
    "query": { //query },
    "filter": { //filter }
  }
}
```
should be replaced with
```json
{
  "bool": {
    "must": { //query },
    "filter": { //filter }
  }
}
```
@jpountz
Copy link
Contributor Author

jpountz commented May 13, 2015

Also for the record: even if the filtered query is still supported for backward-compatibility reasons, it now parses to a bool query and the strategy parameter is ignored.

@kimchy
Copy link
Member

kimchy commented May 13, 2015

LGTM

jpountz added a commit that referenced this pull request May 13, 2015
Query DSL: Add `filter` clauses to `bool` queries.
@jpountz jpountz merged commit 472cc0a into elastic:master May 13, 2015
@kevinkluge kevinkluge removed the review label May 13, 2015
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :Search/Search Search-related issues that do not fall into other categories v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants