Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top