# Passing min\_score to elastic in query

**URL:** https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [April 8, 2020, 12:30am UTC](https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032 "2020-04-08T00:30:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dan\_Leng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_leng/32/65879_2.png) [@Dan\_Leng](https://discuss.elastic.co/u/Dan_Leng)
#### Post date: [April 8, 2020, 12:30am UTC](https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032/1 "2020-04-08T00:30:52Z")

</div>

Hi,

I'm interested in passing the min\_score option to elastic when searching via App Search (from javascript), as described in the elastic docs:

> **[min\_score | Elasticsearch Guide \[6.8\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-min-score.html)**

When I try to do pass that option in my query, App Search throws with the error:

Options contains invalid key: min\_score

Is there a way to pass other options that are available in Elasticsearch but are not necessarily called out in the App Search wrapper? Perhaps there is an escape hatch that I can use to execute a "raw" elastic query like when you're using a DB ORM, can't get it to do what you want, and just want to write the SQL query?

Specifically, I want to do this for 2 reasons...

1. I don't want to display results that are very far off from the query to my users.
2. I want to get a list of facets that apply to my results (with counts) but I don't want facets pertaining to results that are far down the list to be returned.... i.e. it would be great to cut off my list at a point that I define using min\_score, so I don't get facets pertaining to the 1000th result returned.

Any help appreciated,  
Dan

---

<div class="post-metadata">

### Author: ![Dan\_Leng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_leng/32/65879_2.png) [@Dan\_Leng](https://discuss.elastic.co/u/Dan_Leng)
#### Post date: [April 13, 2020, 4:03pm UTC](https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032/2 "2020-04-13T16:03:39Z")

</div>

Assuming that the response from @JasonStoltz in this question:

> [@Random\_score is available on App Search?](https://discuss.elastic.co/t/random-score-is-available-on-app-search/226764):
>
> Hello, I'm trying to get a randomized result using App Search, but I can't find a way to archieve that. I've seen that Elasticsearch does include a random score option ([Random Scoring | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/random-scoring.html)) Is there any way to access to that feature? Thank you

is the same response I'll get here regarding the min\_score function. To @JasonStoltz or someone else who's knowledgable... I can solve the problem of truncating the search results at some score on my end pretty easily. Is there a way to solve the 2nd problem I mentioned above regarding getting facets and counts that apply to a shorter result list?

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [April 20, 2020, 1:21pm UTC](https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032/3 "2020-04-20T13:21:55Z")

</div>

Hey Dan, to my knowledge, that is not possible.

---

<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: [May 18, 2020, 1:21pm UTC](https://discuss.elastic.co/t/passing-min-score-to-elastic-in-query/227032/4 "2020-05-18T13:21:59Z")

</div>

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