2013-08-28 19:24:34 -04:00
|
|
|
[[search-facets-query-facet]]
|
|
|
|
=== Query Facets
|
|
|
|
|
2014-06-12 10:38:10 -04:00
|
|
|
include::deprecated.asciidoc[]
|
|
|
|
|
2014-07-28 09:22:09 -04:00
|
|
|
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>>.
|
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
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" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|