OpenSearch/docs/reference/search/facets/query-facet.asciidoc

26 lines
688 B
Plaintext

[[search-facets-query-facet]]
=== Query Facets
include::deprecated.asciidoc[]
NOTE: There is no equivalent aggregation but you can use the
<<search-aggregations-bucket-filter-aggregation,`filter`>> aggregation and wrap
the query inside a <<query-dsl-query-filter,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:
[source,js]
--------------------------------------------------
{
"facets" : {
"wow_facet" : {
"query" : {
"term" : { "tag" : "wow" }
}
}
}
}
--------------------------------------------------