# Problem on scoring and sorting retrieved documents

**URL:** <https://discuss.elastic.co/t/problem-on-scoring-and-sorting-retrieved-documents/80113>\
**Category:** Elasticsearch\
**Created:** [March 27, 2017, 9:40am UTC](https://discuss.elastic.co/t/problem-on-scoring-and-sorting-retrieved-documents/80113 "2017-03-27T09:40:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [March 27, 2017, 12:27pm UTC](https://discuss.elastic.co/t/problem-on-scoring-and-sorting-retrieved-documents/80113/2 "2017-03-27T12:27:00Z")

</div>

Matching is a combination of a number of factors relating to your choice of analyzers and queries and the documents held inside your index. The explain API [1] can give low-level details on how things are matched.

Before you dive into this it is worth noting that the user's search text input does not have to be translated into a single choice of query clause in the elasticsearch query DSL. It often makes sense to combine multiple query expressions ranging from strict to lax in a single `bool` query's array of `should` expressions. Documents that match all of the expressions (strict and lax) will tend to rank highest. An example of a strict clause might be a query for an exact phrase match on a field analyzed with no stemming etc while an example of a sloppy clause might be the ngram approach you have here.  
Thread: [Synonym Problem](https://discuss.elastic.co/t/synonym-problem/74695/3?u=mark_harwood)

Cheers  
Mark

[1] [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html)

---

_[View the full topic](https://discuss.elastic.co/t/problem-on-scoring-and-sorting-retrieved-documents/80113)._
