Domanda

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

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top