# How getting document match rate?

**URL:** <https://discuss.elastic.co/t/how-getting-document-match-rate/22963>\
**Category:** Elasticsearch\
**Created:** [March 28, 2015, 4:33pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963 "2015-03-28T16:33:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![terrasacer](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@terrasacer](https://discuss.elastic.co/u/terrasacer)\
**Post date:** [March 28, 2015, 4:33pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/1 "2015-03-28T16:33:52Z")

</div>

Hello everyone,

For example my data

[  
{ "id" : 1, "type" : "article", "title" : "About the Java Technology"  
},  
{ "id" : 2, "type" : "article", "title" : "How does ElasticSearch  
work" },  
{ "id" : 3, "type" : "article", "title" : "How to get the count of  
results ElasticSearch" }  
]

When we run the following command

GET myindex/article/\_search  
{  
"query": {  
"bool": {  
"should": [  
{  
"match": {  
"title": "how count elasticsearch"  
}  
}  
]  
}  
}  
}

We get these results

{  
"took": 776,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 2,  
"max\_score": 0.16608897,  
"hits": [  
{  
"\_index": "myindex",  
"\_type": "article",  
"\_id": "3",  
"\_score": 0.16608897,  
"\_source": {  
"title": "How to get the count of results ElasticSearch"  
}  
},  
{  
"\_index": "myindex",  
"\_type": "article",  
"\_id": "2",  
"\_score": 0.05758412,  
"\_source": {  
"title": "How does ElasticSearch work"  
}  
}  
]  
}  
}

Now the question is: Contains a maximum term(how, count and elasticsearch)  
the third document, match 100%

_How can get this information from ElasticSearch?_

I can benefit from the score and max\_scor information when query match is  
100% but when it is not 100% match?

Please help me 🙂

--  
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/d1ba2467-7cd9-4c5b-b934-33ec23ccfdc9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1ba2467-7cd9-4c5b-b934-33ec23ccfdc9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![terrasacer](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@terrasacer](https://discuss.elastic.co/u/terrasacer)\
**Post date:** [March 29, 2015, 2:39pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/2 "2015-03-29T14:39:46Z")

</div>

Is this not possible?

On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:

> Hello everyone,
> 
> For example my data
> 
> [  
> { "id" : 1, "type" : "article", "title" : "About the Java Technology"  
> },  
> { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> work" },  
> { "id" : 3, "type" : "article", "title" : "How to get the count of  
> results Elasticsearch" }  
> ]
> 
> When we run the following command
> 
> GET myindex/article/\_search  
> {  
> "query": {  
> "bool": {  
> "should": [  
> {  
> "match": {  
> "title": "how count elasticsearch"  
> }  
> }  
> ]  
> }  
> }  
> }
> 
> We get these results
> 
> {  
> "took": 776,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 2,  
> "max\_score": 0.16608897,  
> "hits": [  
> {  
> "\_index": "myindex",  
> "\_type": "article",  
> "\_id": "3",  
> "\_score": 0.16608897,  
> "\_source": {  
> "title": "How to get the count of results Elasticsearch"  
> }  
> },  
> {  
> "\_index": "myindex",  
> "\_type": "article",  
> "\_id": "2",  
> "\_score": 0.05758412,  
> "\_source": {  
> "title": "How does Elasticsearch work"  
> }  
> }  
> ]  
> }  
> }
> 
> Now the question is: Contains a maximum term(how, count and elasticsearch)  
> the third document, match 100%
> 
> _How can get this information from Elasticsearch?_
> 
> I can benefit from the score and max\_scor information when query match is  
> 100% but when it is not 100% match?
> 
> Please help me 🙂

--  
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/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 29, 2015, 8:00pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/3 "2015-03-29T20:00:53Z")

</div>

Hi Terra,

This information is not available. For debugging purposes though, you can  
use 'explain' to have an explanation of how the score was computed, which  
will also tell you which clauses matched:

> **[Explain API | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html)**

On Sun, Mar 29, 2015 at 4:39 PM, Terra Sacer [terrasacer@gmail.com](mailto:terrasacer@gmail.com) wrote:

> Is this not possible?
> 
> On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:
> 
> > Hello everyone,
> > 
> > For example my data
> > 
> > [  
> > { "id" : 1, "type" : "article", "title" : "About the Java  
> > Technology" },  
> > { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> > work" },  
> > { "id" : 3, "type" : "article", "title" : "How to get the count of  
> > results Elasticsearch" }  
> > ]
> > 
> > When we run the following command
> > 
> > GET myindex/article/\_search  
> > {  
> > "query": {  
> > "bool": {  
> > "should": [  
> > {  
> > "match": {  
> > "title": "how count elasticsearch"  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > }
> > 
> > We get these results
> > 
> > {  
> > "took": 776,  
> > "timed\_out": false,  
> > "\_shards": {  
> > "total": 5,  
> > "successful": 5,  
> > "failed": 0  
> > },  
> > "hits": {  
> > "total": 2,  
> > "max\_score": 0.16608897,  
> > "hits": [  
> > {  
> > "\_index": "myindex",  
> > "\_type": "article",  
> > "\_id": "3",  
> > "\_score": 0.16608897,  
> > "\_source": {  
> > "title": "How to get the count of results Elasticsearch"  
> > }  
> > },  
> > {  
> > "\_index": "myindex",  
> > "\_type": "article",  
> > "\_id": "2",  
> > "\_score": 0.05758412,  
> > "\_source": {  
> > "title": "How does Elasticsearch work"  
> > }  
> > }  
> > ]  
> > }  
> > }
> > 
> > Now the question is: Contains a maximum term(how, count and  
> > elasticsearch) the third document, match 100%
> > 
> > _How can get this information from Elasticsearch?_
> > 
> > I can benefit from the score and max\_scor information when query match is  
> > 100% but when it is not 100% match?
> > 
> > Please help me 🙂
> 
> --  
> 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/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
[http://www.elastic.co](http://www.elastic.co)

--  
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/CAO5%3DkAhmke9y%2B-Gnk4AFFHsySsZMwaKqpUU6VyqL8A-AjCTp%2Bg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAhmke9y%2B-Gnk4AFFHsySsZMwaKqpUU6VyqL8A-AjCTp%2Bg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 29, 2015, 8:10pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/4 "2015-03-29T20:10:49Z")

</div>

The scoring is relative to the other documents and as such there is no such  
thing as a 100% match.

On 30 March 2015 at 01:39, Terra Sacer [terrasacer@gmail.com](mailto:terrasacer@gmail.com) wrote:

> Is this not possible?
> 
> On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:
> 
> > Hello everyone,
> > 
> > For example my data
> > 
> > [  
> > { "id" : 1, "type" : "article", "title" : "About the Java  
> > Technology" },  
> > { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> > work" },  
> > { "id" : 3, "type" : "article", "title" : "How to get the count of  
> > results Elasticsearch" }  
> > ]
> > 
> > When we run the following command
> > 
> > GET myindex/article/\_search  
> > {  
> > "query": {  
> > "bool": {  
> > "should": [  
> > {  
> > "match": {  
> > "title": "how count elasticsearch"  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > }
> > 
> > We get these results
> > 
> > {  
> > "took": 776,  
> > "timed\_out": false,  
> > "\_shards": {  
> > "total": 5,  
> > "successful": 5,  
> > "failed": 0  
> > },  
> > "hits": {  
> > "total": 2,  
> > "max\_score": 0.16608897,  
> > "hits": [  
> > {  
> > "\_index": "myindex",  
> > "\_type": "article",  
> > "\_id": "3",  
> > "\_score": 0.16608897,  
> > "\_source": {  
> > "title": "How to get the count of results Elasticsearch"  
> > }  
> > },  
> > {  
> > "\_index": "myindex",  
> > "\_type": "article",  
> > "\_id": "2",  
> > "\_score": 0.05758412,  
> > "\_source": {  
> > "title": "How does Elasticsearch work"  
> > }  
> > }  
> > ]  
> > }  
> > }
> > 
> > Now the question is: Contains a maximum term(how, count and  
> > elasticsearch) the third document, match 100%
> > 
> > _How can get this information from Elasticsearch?_
> > 
> > I can benefit from the score and max\_scor information when query match is  
> > 100% but when it is not 100% match?
> > 
> > Please help me 🙂
> 
> --  
> 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/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAEYi1X\_bkGteKHUrexnJLEhtCP\_vVOZbC3j3BGsxUaQ6uuXoqg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_bkGteKHUrexnJLEhtCP_vVOZbC3j3BGsxUaQ6uuXoqg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![terrasacer](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@terrasacer](https://discuss.elastic.co/u/terrasacer)\
**Post date:** [March 30, 2015, 12:08pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/5 "2015-03-30T12:08:35Z")

</div>

Hi Adrien,

I know the explain api but I couldn't find the effective way of getting  
information from the api.

Thanks.

On Sunday, March 29, 2015 at 11:01:15 PM UTC+3, Adrien Grand wrote:

> Hi Terra,
> 
> This information is not available. For debugging purposes though, you can  
> use 'explain' to have an explanation of how the score was computed, which  
> will also tell you which clauses matched:  
> [Explain API | Elasticsearch Guide [8.11] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html)
> 
> On Sun, Mar 29, 2015 at 4:39 PM, Terra Sacer \<[terra...@gmail.com](mailto:terra...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Is this not possible?
> > 
> > On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:
> > 
> > > Hello everyone,
> > > 
> > > For example my data
> > > 
> > > [  
> > > { "id" : 1, "type" : "article", "title" : "About the Java  
> > > Technology" },  
> > > { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> > > work" },  
> > > { "id" : 3, "type" : "article", "title" : "How to get the count of  
> > > results Elasticsearch" }  
> > > ]
> > > 
> > > When we run the following command
> > > 
> > > GET myindex/article/\_search  
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "should": [  
> > > {  
> > > "match": {  
> > > "title": "how count elasticsearch"  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > We get these results
> > > 
> > > {  
> > > "took": 776,  
> > > "timed\_out": false,  
> > > "\_shards": {  
> > > "total": 5,  
> > > "successful": 5,  
> > > "failed": 0  
> > > },  
> > > "hits": {  
> > > "total": 2,  
> > > "max\_score": 0.16608897,  
> > > "hits": [  
> > > {  
> > > "\_index": "myindex",  
> > > "\_type": "article",  
> > > "\_id": "3",  
> > > "\_score": 0.16608897,  
> > > "\_source": {  
> > > "title": "How to get the count of results Elasticsearch"  
> > > }  
> > > },  
> > > {  
> > > "\_index": "myindex",  
> > > "\_type": "article",  
> > > "\_id": "2",  
> > > "\_score": 0.05758412,  
> > > "\_source": {  
> > > "title": "How does Elasticsearch work"  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }
> > > 
> > > Now the question is: Contains a maximum term(how, count and  
> > > elasticsearch) the third document, match 100%
> > > 
> > > _How can get this information from Elasticsearch?_
> > > 
> > > I can benefit from the score and max\_scor information when query match  
> > > is 100% but when it is not 100% match?
> > > 
> > > Please help me 🙂
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> [http://www.elastic.co](http://www.elastic.co)

--  
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/b02a5049-47dc-45eb-acb0-1788dd945ead%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b02a5049-47dc-45eb-acb0-1788dd945ead%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![terrasacer](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@terrasacer](https://discuss.elastic.co/u/terrasacer)\
**Post date:** [March 30, 2015, 12:14pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/6 "2015-03-30T12:14:15Z")

</div>

I understand that, but if the relative even can be said %66 match to  
document that contains two of the three terms.

On Sunday, March 29, 2015 at 11:11:28 PM UTC+3, Mark Walkom wrote:

> The scoring is relative to the other documents and as such there is no  
> such thing as a 100% match.
> 
> On 30 March 2015 at 01:39, Terra Sacer \<[terra...@gmail.com](mailto:terra...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Is this not possible?
> > 
> > On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:
> > 
> > > Hello everyone,
> > > 
> > > For example my data
> > > 
> > > [  
> > > { "id" : 1, "type" : "article", "title" : "About the Java  
> > > Technology" },  
> > > { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> > > work" },  
> > > { "id" : 3, "type" : "article", "title" : "How to get the count of  
> > > results Elasticsearch" }  
> > > ]
> > > 
> > > When we run the following command
> > > 
> > > GET myindex/article/\_search  
> > > {  
> > > "query": {  
> > > "bool": {  
> > > "should": [  
> > > {  
> > > "match": {  
> > > "title": "how count elasticsearch"  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > We get these results
> > > 
> > > {  
> > > "took": 776,  
> > > "timed\_out": false,  
> > > "\_shards": {  
> > > "total": 5,  
> > > "successful": 5,  
> > > "failed": 0  
> > > },  
> > > "hits": {  
> > > "total": 2,  
> > > "max\_score": 0.16608897,  
> > > "hits": [  
> > > {  
> > > "\_index": "myindex",  
> > > "\_type": "article",  
> > > "\_id": "3",  
> > > "\_score": 0.16608897,  
> > > "\_source": {  
> > > "title": "How to get the count of results Elasticsearch"  
> > > }  
> > > },  
> > > {  
> > > "\_index": "myindex",  
> > > "\_type": "article",  
> > > "\_id": "2",  
> > > "\_score": 0.05758412,  
> > > "\_source": {  
> > > "title": "How does Elasticsearch work"  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }
> > > 
> > > Now the question is: Contains a maximum term(how, count and  
> > > elasticsearch) the third document, match 100%
> > > 
> > > _How can get this information from Elasticsearch?_
> > > 
> > > I can benefit from the score and max\_scor information when query match  
> > > is 100% but when it is not 100% match?
> > > 
> > > Please help me 🙂
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f8ea789f-edfa-4351-b939-d815ddbd2c9f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/db095183-18d1-4380-8c96-593df89231df%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/db095183-18d1-4380-8c96-593df89231df%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![terrasacer](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@terrasacer](https://discuss.elastic.co/u/terrasacer)\
**Post date:** [March 31, 2015, 12:07pm UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/7 "2015-03-31T12:07:44Z")

</div>

Hi guys,

The Explain api returns coord in bool query. This could work.

On Saturday, March 28, 2015 at 6:33:53 PM UTC+2, Terra Sacer wrote:

> Hello everyone,
> 
> For example my data
> 
> [  
> { "id" : 1, "type" : "article", "title" : "About the Java Technology"  
> },  
> { "id" : 2, "type" : "article", "title" : "How does Elasticsearch  
> work" },  
> { "id" : 3, "type" : "article", "title" : "How to get the count of  
> results Elasticsearch" }  
> ]
> 
> When we run the following command
> 
> GET myindex/article/\_search  
> {  
> "query": {  
> "bool": {  
> "should": [  
> {  
> "match": {  
> "title": "how count elasticsearch"  
> }  
> }  
> ]  
> }  
> }  
> }
> 
> We get these results
> 
> {  
> "took": 776,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 5,  
> "successful": 5,  
> "failed": 0  
> },  
> "hits": {  
> "total": 2,  
> "max\_score": 0.16608897,  
> "hits": [  
> {  
> "\_index": "myindex",  
> "\_type": "article",  
> "\_id": "3",  
> "\_score": 0.16608897,  
> "\_source": {  
> "title": "How to get the count of results Elasticsearch"  
> }  
> },  
> {  
> "\_index": "myindex",  
> "\_type": "article",  
> "\_id": "2",  
> "\_score": 0.05758412,  
> "\_source": {  
> "title": "How does Elasticsearch work"  
> }  
> }  
> ]  
> }  
> }
> 
> Now the question is: Contains a maximum term(how, count and elasticsearch)  
> the third document, match 100%
> 
> _How can get this information from Elasticsearch?_
> 
> I can benefit from the score and max\_scor information when query match is  
> 100% but when it is not 100% match?
> 
> Please help me 🙂

--  
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/8546ca39-30f9-4159-b205-99263034ac13%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8546ca39-30f9-4159-b205-99263034ac13%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, 12:22am UTC](https://discuss.elastic.co/t/how-getting-document-match-rate/22963/8 "2017-07-06T00:22:48Z")

</div>


