# Query\_string & min\_score?

**URL:** <https://discuss.elastic.co/t/query-string-min-score/241693>\
**Category:** Elasticsearch\
**Created:** [July 17, 2020, 4:18pm UTC](https://discuss.elastic.co/t/query-string-min-score/241693 "2020-07-17T16:18:25Z")\
**Posts on this page:** 2\
**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 17, 2020, 4:18pm UTC](https://discuss.elastic.co/t/query-string-min-score/241693/1 "2020-07-17T16:18:26Z")

</div>

Hi,

I have a basic query, and I wish to exclude all the results when the score is \< 0.5.

It seems that min\_score does not work with!

Noticed that I have a random\_score, if I use min\_score in "functions" it will be applied after the random, but I want to filter the result of the "query" or "query\_string".

Is there a way ?

```
POST /posts_index/_search
{
	"track_total_hits": true,
	"from":10,
	"size":10,
	"_source": [
		"id",
		"tags",
		"taxonomies",
        "storesNames",
		"geoLocations",
		"storesIds",
		"imageUri",
		"imageTags"
	],	
	"query": {
		"function_score": {
			"query": {
				"bool": {
					"should": [
						{
							"query_string": {
								"fields": [
									"tags^3"
								],
								"query": "camera",
								"fuzziness": "auto"
						}
					}],
					"filter" : {
						"geo_distance" : {
							"distance" : "5km",
							"geoLocations" : {
								"lat" : 51.507611,
								"lon" : -0.127754
							}
						}
					}
				}
			},
			"functions": [
				{
					"random_score" : {
						"seed": 1,
						"field": "updateTime"
					}
				}
			],
			"score_mode": "multiply"
		}
	}
}
```

---

<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 14, 2020, 4:18pm UTC](https://discuss.elastic.co/t/query-string-min-score/241693/2 "2020-08-14T16:18:34Z")

</div>

Closed on August 14, 2020, 4:18pm UTC

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