WARNING: Version 1.7 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Query Facets
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Query Facets
editFacets are deprecated and will be removed in a future release. You are encouraged to migrate to aggregations instead.
There is no equivalent aggregation but you can use the
filter
aggregation and wrap
the query inside a query filter.
A facet query allows to return a count of the hits matching the facet query. The query itself can be expressed using the Query DSL. For example:
{ "facets" : { "wow_facet" : { "query" : { "term" : { "tag" : "wow" } } } } }