# How to debug relevance in DSL queries

**URL:** <https://discuss.elastic.co/t/how-to-debug-relevance-in-dsl-queries/241357>\
**Category:** Elasticsearch\
**Created:** [July 15, 2020, 8:03pm UTC](https://discuss.elastic.co/t/how-to-debug-relevance-in-dsl-queries/241357 "2020-07-15T20:03:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClubberLang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clubberlang/32/72169_2.png) [@ClubberLang](https://discuss.elastic.co/u/ClubberLang)\
**Post date:** [July 15, 2020, 8:03pm UTC](https://discuss.elastic.co/t/how-to-debug-relevance-in-dsl-queries/241357/1 "2020-07-15T20:03:43Z")

</div>

Hi,

I'm working on my first set of queries, but I wish to 'debug' and see:

- which part of my query match
- what is the computed score for anything involved in the computation of the final score.

For the first, it seems I can play with highlight, but for the last it sounds more complex.

Even better, if I can have the details about how each score is computed for each result (the complete formula)... it will be amazing.

Do you think it is possible ? Or you have other technics/methods?

Thanks

---

<div class="post-metadata">

**Author:** ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)\
**Post date:** [July 15, 2020, 8:09pm UTC](https://discuss.elastic.co/t/how-to-debug-relevance-in-dsl-queries/241357/2 "2020-07-15T20:09:33Z")

</div>

@ClubberLang

Add explain true to the query or use explain api [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html)

---

<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:** [August 12, 2020, 8:09pm UTC](https://discuss.elastic.co/t/how-to-debug-relevance-in-dsl-queries/241357/3 "2020-08-12T20:09:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
