Multiple filters and an aggregate in elasticsearch

前端 未结 4 662
广开言路
广开言路 2020-12-14 01:26

How can I use a filter in connection with an aggregate in elasticsearch?

The official documentation gives only trivial examples for filter and for aggregations and n

4条回答
  •  旧时难觅i
    2020-12-14 01:45

    Put your filter in a filtered-query.

    The top-level filter is for filtering search hits only, and not facets/aggregations. It was renamed to post_filter in 1.0 due to this quite common confusion.

    Also, you might want to look into this post on why you often want to use bool and not and/or: http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/

提交回复
热议问题