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

Filter context

PreviousQuery contextNextFiltered Vs filter

Last updated 5 years ago

Was this helpful?

Filter context is in effect whenever a query clause is passed to a filter parameter, such as the filter or must_notparameters in the query, the filter parameter in the query, or the aggregation.

In filter context, a query clause answers the question “Does this document match this query clause?” The answer is a simple Yes or No — no scores are calculated. Filter context is mostly used for filtering structured data, e.g.

  • Does this timestamp fall into the range 2015 to 2016?

  • Is the status field set to "published"?

Frequently used filters will be cached automatically by Elasticsearch, to speed up performance.

bool
constant_score
filter