# How to find out why certain document matches the query

**URL:** <https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781>\
**Category:** Elasticsearch\
**Created:** [July 5, 2011, 3:37pm UTC](https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781 "2011-07-05T15:37:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [July 5, 2011, 3:37pm UTC](https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781/1 "2011-07-05T15:37:34Z")

</div>

Hello Elastic Users,

In Endeca world, there is a special property called "WhyDidItMatch"  
which is pretty helpful in determining why certain documents is part  
of a result set. Apologies for using Endeca as point of reference by  
the way.

Do we have such equivalent status/functionality in ElasticSearch?

Regards,  
Raul

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [July 5, 2011, 4:10pm UTC](https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781/2 "2011-07-05T16:10:03Z")

</div>

Hi,

Did you try using explain?  
[http://www.elasticsearch.org/guide/reference/api/search/explain.html](http://www.elasticsearch.org/guide/reference/api/search/explain.html)

Regards,  
Lukas

On Tuesday, July 5, 2011, rmartinez [juneym@gmail.com](mailto:juneym@gmail.com) wrote:  
\> Hello Elastic Users,  
\>  
\> In Endeca world, there is a special property called  
"WhyDidItMatch"  
\> which is pretty helpful in determining why certain documents is part  
\> of a result set. Apologies for using Endeca as point of reference by  
\> the way.  
\>  
\> Do we have such equivalent status/functionality in ElasticSearch?  
\>  
\>  
\> Regards,  
\> Raul  
\>

---

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [July 5, 2011, 4:47pm UTC](https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781/3 "2011-07-05T16:47:58Z")

</div>

Hi Lukas,

Interesting. I didn't realize this. I will try this out. Thanks!

Raul

On Jul 6, 12:10 am, Lukáš Vlček [lukas.vl...@gmail.com](mailto:lukas.vl...@gmail.com) wrote:

> Hi,
> 
> Did you try using explain?[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/explain.html)
> 
> Regards,  
> Lukas
> 
> On Tuesday, July 5, 2011, rmartinez [jun...@gmail.com](mailto:jun...@gmail.com) wrote:
> 
> \> Hello Elastic Users,  
> \>  
> \> In Endeca world, there is a special property called  
> "WhyDidItMatch"  
> \> which is pretty helpful in determining why certain documents is part  
> \> of a result set. Apologies for using Endeca as point of reference by  
> \> the way.  
> \>  
> \> Do we have such equivalent status/functionality in Elasticsearch?  
> \>  
> \>  
> \> Regards,  
> \> Raul  
> \>

---

<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, 4:01am UTC](https://discuss.elastic.co/t/how-to-find-out-why-certain-document-matches-the-query/4781/4 "2017-07-06T04:01:41Z")

</div>


