# Search query with Facets

**URL:** <https://discuss.elastic.co/t/search-query-with-facets/12281>\
**Category:** Elasticsearch\
**Created:** [June 5, 2013, 3:53pm UTC](https://discuss.elastic.co/t/search-query-with-facets/12281 "2013-06-05T15:53:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_B](https://avatars.discourse-cdn.com/v4/letter/h/df788c/32.png) [@Hari\_B](https://discuss.elastic.co/u/Hari_B)\
**Post date:** [June 5, 2013, 3:53pm UTC](https://discuss.elastic.co/t/search-query-with-facets/12281/1 "2013-06-05T15:53:24Z")

</div>

Hi,

We have indexed wikipedia using the wikipedia-river plugin, and have made \*  
category\* field to use _keyword_ analyser. Our Search queries faceted by  
category is taking a lot of Memory and CPU.

1. Why is it taking such high CPU and memory? Can anyone explain what is  
happening behind the scenes when fetching the search results.
2. Is there a way we can optimise so that we reduce the amount of memory  
and CPU that is being consumed?

The query we used to search with facets

{  
"query": {  
"query\_string": {  
"query": "developer"  
}  
},  
"facets": {  
"tag": {  
"terms": {  
"field": "category"  
}  
}  
},  
"fields": [  
"title"  
]  
}

Thanks.  
Hari

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:32am UTC](https://discuss.elastic.co/t/search-query-with-facets/12281/2 "2017-07-06T02:32:44Z")

</div>

Closed on July 6, 2017, 2:32am UTC


