# Performance trick? how

**URL:** <https://discuss.elastic.co/t/performance-trick-how/12918>\
**Category:** Elasticsearch\
**Created:** [July 24, 2013, 1:46pm UTC](https://discuss.elastic.co/t/performance-trick-how/12918 "2013-07-24T13:46:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crwe](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@Crwe](https://discuss.elastic.co/u/Crwe)\
**Post date:** [July 24, 2013, 1:46pm UTC](https://discuss.elastic.co/t/performance-trick-how/12918/1 "2013-07-24T13:46:30Z")

</div>

I have to calculate a difference between "number of results" vs. "number of  
results for a slightly modified query".

The "number of results is known", and I am using the "/\_count" API to get  
the number of results of "slightly modified query".

Problem is, I have to run many such "slightly modified queries", one for  
each displayed facet =\> 50 "/\_count" queries. The difference in numbers  
will show user how many results he will get after clicking on a facet.

The queries are almost identical -- is there a way to leverage this fact?  
Some caching hints? Submit all queries to ES at once, instead of calling  
/\_count fifty times?

--  
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:24am UTC](https://discuss.elastic.co/t/performance-trick-how/12918/2 "2017-07-06T02:24:43Z")

</div>


