質問

I have a document mapping that looks like this:

_id : integer
title: string
category: string
country: string

Given a search by 'title' i would like to get the amount of results found in all categories and all countries, so something like

countries:
   USA: 38
   UK: 17
   ES: 5
   ....

categories:
   Animals: 6
   People:  772
   Objects: 87
   ....

Is it possible to do this in Elastic Search?

Thanks

役に立ちましたか?

解決

Yes, this is the standard behavior for faceting in Elasticsearch. Please refer to the Elasticsearch Facets documentation for more information and examples.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top