# Result the number of matched terms for a given result

**URL:** https://discuss.elastic.co/t/result-the-number-of-matched-terms-for-a-given-result/18232
**Category:** Elasticsearch
**Created:** [June 20, 2014, 2:41pm UTC](https://discuss.elastic.co/t/result-the-number-of-matched-terms-for-a-given-result/18232 "2014-06-20T14:41:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dan\_Harvey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_harvey/32/1471_2.png) [@Dan\_Harvey](https://discuss.elastic.co/u/Dan_Harvey)
#### Post date: [June 20, 2014, 2:41pm UTC](https://discuss.elastic.co/t/result-the-number-of-matched-terms-for-a-given-result/18232/1 "2014-06-20T14:41:21Z")

</div>

Hi,

Is it possible to get elasticsearch to return the number of terms matched  
per result in a query. I know these are evaluated as they make up the score  
but there doesn't seem to be a way to get a simple count?

For example with :query =\> {:in =\> {:user\_ids =\> [user\_ids...],  
:minimum\_should\_match =\> 1}}

I would like to know how many user\_ids were matched.

Thanks,  
Dan

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b5cd6753-f166-4ae5-8c61-844650efa859%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b5cd6753-f166-4ae5-8c61-844650efa859%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:20am UTC](https://discuss.elastic.co/t/result-the-number-of-matched-terms-for-a-given-result/18232/2 "2017-07-06T01:20:54Z")

</div>


