Efficient way to compute *Facet Counts* in Elastic Search

一个人想着一个人 提交于 2019-11-30 10:21:00

The only way I've found this to work is via the following logic for any multi-select facet:

Whenever the user selects a value from a facet ("drills down") you add a corresponding filter to all facets (via facet_filter) except the facet that the selection was done in, as well as to the top-level filter to filter the query results.

In other words, given 3 multi-select facets, A, B & C:

  • Select value from A => Add filter to top-level filter as well as to the facet_filter of facet B and C.
  • Select value from B => Add filter to top-level filter as well as to the facet_filter of A & C.
  • ... and so on

The top-level filter always combines the filters for all selections, whereas each individual facet contains facet_filters according to the selection in the other facets.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!