Elastic Search Notes
  • Introduction
  • Full Text
  • Aggregations
    • Facets Vs Aggregations
  • Filters
  • References
  • Tools
  • Query DSL
    • Query and filter context
      • Query context
      • Filter context
      • Filtered Vs filter
      • termQuery vs. termFilter
    • Term level queries vs full text queries
  • Parent Child Relationship
  • Nodes
    • Master Node
  • Elastic Search Networking
  • Logstash
    • HighAvailability
    • Grok patterns
  • KeyConcepts
    • Shard
    • Segment
    • Translog
  • Document CRUD operations
    • Updates
  • adv topics
  • Relevance
    • BM25 Scoring Formula
  • Named Queries
Powered by GitBook
On this page

Was this helpful?

  1. Query DSL
  2. Query and filter context

Filtered Vs filter

PreviousFilter contextNexttermQuery vs. termFilter

Last updated 5 years ago

Was this helpful?

(Old 1.x Syntax) queries have been deprecated in favor of

Mastering Elasticsearch 5.x

with the release of Lucene 5.0, which is used by

Elasticsearch version 2.0.0, both queries and filters became the same

internal object, taking care of both document relevance and matching.

So, an Elasticsearch query that used to look like the following

{"

filtered" : {

"query": { query definition },

"filter": { filter definition }

}

}

It should now be written like this in version 2.x:

{"

bool" : {

"must": { query definition },

"filter": { filter definition }

}}

https://stackoverflow.com/questions/38744489/filtered-bool-vs-bool-query-elasticsearch
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html
filtered
bool/filter