# Query to get all records with top score

**URL:** <https://discuss.elastic.co/t/query-to-get-all-records-with-top-score/167447>\
**Category:** Elasticsearch\
**Created:** [February 7, 2019, 12:15pm UTC](https://discuss.elastic.co/t/query-to-get-all-records-with-top-score/167447 "2019-02-07T12:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [February 7, 2019, 12:15pm UTC](https://discuss.elastic.co/t/query-to-get-all-records-with-top-score/167447/1 "2019-02-07T12:15:34Z")

</div>

I have a match query which returns 10 documents.  
6 having score "10.0" and 4 having having score "8.0".

**Query:**  
I want to have an ability in same match query that should return all documents with top score only i.e. "10.0". All with score "8.0" should not be returned in the query.

Any suggestions ?

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [February 15, 2019, 9:23pm UTC](https://discuss.elastic.co/t/query-to-get-all-records-with-top-score/167447/2 "2019-02-15T21:23:12Z")

</div>

You can nest your original match query within a [min\_score](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-min-score.html) query, specifying the minimum score that a document must have to be returned.

---

<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:** [March 15, 2019, 9:23pm UTC](https://discuss.elastic.co/t/query-to-get-all-records-with-top-score/167447/3 "2019-03-15T21:23:25Z")

</div>

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