Simulating field collapsing/grouping by field in Elastic Search

你。 提交于 2019-12-14 01:41:47

问题


Elastic Search does not currently (as of 0.18.4) support field collapsing. Is there a good way to simulate this, as to avoid N search queries?


回答1:


Probably not the answer you're looking for but: As far as I know, and according to this ticket, the only real workaround is to select a larger result set and group on the client side.




回答2:


Depending on what your use case is you might find parent/child support or nested types useful instead.

You can find more about parent/child support here: https://github.com/elasticsearch/elasticsearch/issues/553 (and then in corresponding query/filter doc pages)

As for nested types, check here: http://www.elasticsearch.org/guide/reference/mapping/nested-type.html



来源:https://stackoverflow.com/questions/8304418/simulating-field-collapsing-grouping-by-field-in-elastic-search

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