Implementing a category filter
Normally, the category fields are of the type string. We need to index this unanalyzed field to match the exact term. In fact, Elasticsearch uses a term filter for the purpose of matching strings:
The following snippet shows you how to use a terms filter:
{ "filtered" : { "filter" : { "term" : { "category" : "Books" } } } }