# Unable to get the min\_score search criteria working in 0.90.0

**URL:** https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424
**Category:** Elasticsearch
**Created:** [June 14, 2013, 8:50pm UTC](https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424 "2013-06-14T20:50:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jieren](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jieren](https://discuss.elastic.co/u/jieren)
#### Post date: [June 14, 2013, 8:50pm UTC](https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424/1 "2013-06-14T20:50:15Z")

</div>

Hi there!

We've been having some trouble getting min\_score to work.

We have two types. There is user\_meta, the parent index type. There is also  
the child index, user\_perk (specified below.)

The query returns both the right documents and accurate scores for those  
documents, but when I add a min\_score \>= 1, it returns no data.

Another weird behavior is that changing the boost value in constant\_score  
does not change the score that is returned. For example, if I have a boost  
value of 1 and a document that has a score of 29, that document will also  
have a score of 29 if I set a boost value of 0.1.

Very confused here. Are we doing something wrong?

Thanks!  
Jieren

_Mapping for child document_  
{  
"user\_perk": {  
"\_parent" : {"type" : "user\_meta"},  
"type": "object",  
"index\_analyzer": "keyword",  
"search\_analyzer": "keyword",  
"properties": {  
"quest\_id": {"type": "string"},  
"ks\_uid": {"type": "string"},  
"status": {"type": "string"},  
"action\_dt" : {"type": "date", "format": "YYYYMMdd"}  
}  
}  
}'

_Query_  
{  
"min\_score": 5,  
"query": {  
"has\_child": {  
"type": "user\_perk",  
"score\_type": "sum",  
"query": {  
"constant\_score": {  
"boost": 1,  
"filter": {  
"term": {  
"status": "claimed"  
}  
}  
}  
}  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jieren](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jieren](https://discuss.elastic.co/u/jieren)
#### Post date: [June 17, 2013, 8:39pm UTC](https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424/2 "2013-06-17T20:39:31Z")

</div>

Upping.

On Friday, June 14, 2013 1:50:15 PM UTC-7, jieren wrote:

> Hi there!
> 
> We've been having some trouble getting min\_score to work.
> 
> We have two types. There is user\_meta, the parent index type. There is  
> also the child index, user\_perk (specified below.)
> 
> The query returns both the right documents and accurate scores for those  
> documents, but when I add a min\_score \>= 1, it returns no data.
> 
> Another weird behavior is that changing the boost value in constant\_score  
> does not change the score that is returned. For example, if I have a boost  
> value of 1 and a document that has a score of 29, that document will also  
> have a score of 29 if I set a boost value of 0.1.
> 
> Very confused here. Are we doing something wrong?
> 
> Thanks!  
> Jieren
> 
> _Mapping for child document_  
> {  
> "user\_perk": {  
> "\_parent" : {"type" : "user\_meta"},  
> "type": "object",  
> "index\_analyzer": "keyword",  
> "search\_analyzer": "keyword",  
> "properties": {  
> "quest\_id": {"type": "string"},  
> "ks\_uid": {"type": "string"},  
> "status": {"type": "string"},  
> "action\_dt" : {"type": "date", "format": "YYYYMMdd"}  
> }  
> }  
> }'
> 
> _Query_  
> {  
> "min\_score": 5,  
> "query": {  
> "has\_child": {  
> "type": "user\_perk",  
> "score\_type": "sum",  
> "query": {  
> "constant\_score": {  
> "boost": 1,  
> "filter": {  
> "term": {  
> "status": "claimed"  
> }  
> }  
> }  
> }  
> }  
> }  
> }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jieren](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jieren](https://discuss.elastic.co/u/jieren)
#### Post date: [June 18, 2013, 10:43pm UTC](https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424/3 "2013-06-18T22:43:27Z")

</div>

Opening an issue:

> <https://github.com/elastic/elasticsearch/issues/3203>
>
> how to replicate:
> 
> Create index test
> curl -XPOST ‘http://localhost:9200/test’
> 
> P…arent docs
> curl -XPOST 'http://localhost:9200/test/testP/1' -d '{"yes" : "1"}'
> curl -XPOST 'http://localhost:9200/test/testP/2' -d '{"yes" : "2"}'
> 
> Create child mapping
> curl -XPUT 'http://localhost:9200/test/testC/\_mapping' -d '{"testC" : {"type" : "object", "\_parent" : {"type" : "testP"}}}'
> 
> Child docs
> curl -XPOST 'http://localhost:9200/test/testC?parent=1' -d '{"yes" : "2"}'
> curl -XPOST 'http://localhost:9200/test/testC?parent=1' -d '{"yes" : "2"}'
> curl -XPOST 'http://localhost:9200/test/testC?parent=1' -d '{"yes" : "2"}'
> curl -XPOST 'http://localhost:9200/test/testC?parent=2' -d '{"yes" : "2"}'
> 
> Query returns empty:
> {
> "min\_score": 1,
> "query": {
> "has\_child": {
> "query": {
> "constant\_score": {
> "filter": {
> "match\_all": {}
> }
> }
> },
> "child\_type": "testC",
> "score\_type": "sum"
> }
> }
> }

On Friday, June 14, 2013 1:50:15 PM UTC-7, jieren wrote:

> Hi there!
> 
> We've been having some trouble getting min\_score to work.
> 
> We have two types. There is user\_meta, the parent index type. There is  
> also the child index, user\_perk (specified below.)
> 
> The query returns both the right documents and accurate scores for those  
> documents, but when I add a min\_score \>= 1, it returns no data.
> 
> Another weird behavior is that changing the boost value in constant\_score  
> does not change the score that is returned. For example, if I have a boost  
> value of 1 and a document that has a score of 29, that document will also  
> have a score of 29 if I set a boost value of 0.1.
> 
> Very confused here. Are we doing something wrong?
> 
> Thanks!  
> Jieren
> 
> _Mapping for child document_  
> {  
> "user\_perk": {  
> "\_parent" : {"type" : "user\_meta"},  
> "type": "object",  
> "index\_analyzer": "keyword",  
> "search\_analyzer": "keyword",  
> "properties": {  
> "quest\_id": {"type": "string"},  
> "ks\_uid": {"type": "string"},  
> "status": {"type": "string"},  
> "action\_dt" : {"type": "date", "format": "YYYYMMdd"}  
> }  
> }  
> }'
> 
> _Query_  
> {  
> "min\_score": 5,  
> "query": {  
> "has\_child": {  
> "type": "user\_perk",  
> "score\_type": "sum",  
> "query": {  
> "constant\_score": {  
> "boost": 1,  
> "filter": {  
> "term": {  
> "status": "claimed"  
> }  
> }  
> }  
> }  
> }  
> }  
> }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [July 6, 2017, 2:30am UTC](https://discuss.elastic.co/t/unable-to-get-the-min-score-search-criteria-working-in-0-90-0/12424/4 "2017-07-06T02:30:31Z")

</div>


