ES: histogram phase with a bevel of the histogram with all_terms = true

Elasticsearch Histogramfacet does not show support all_terms = true (e.g .: return facetvalue / bucket, although count = 0)

Is it correct?

+3
source share
1 answer

Yes this is correct. However, if you are not using relevance to sort the results, you can move your query to the top level filter element and put match_all into the top level query element. For example, for the following query, two histograms are returned - one with only the elements matching the query, and the other for the entire index:

 { "query": { "match_all": {} }, "filter": { // filter goes here }, "facets": { "histo_all": { "histogram": { "field": "my_field" } }, "histo": { "histogram": { "field": "my_field" }, "facet_filter": { // same filter from top-level filter goes here } } } } 
+3
source

Source: https://habr.com/ru/post/1482585/


All Articles