# Max\_score is not coming for query with filter search

**URL:** <https://discuss.elastic.co/t/max-score-is-not-coming-for-query-with-filter-search/16374>\
**Category:** Elasticsearch\
**Created:** [March 14, 2014, 12:36pm UTC](https://discuss.elastic.co/t/max-score-is-not-coming-for-query-with-filter-search/16374 "2014-03-14T12:36:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bagui/32/960_2.png) [@bagui](https://discuss.elastic.co/u/bagui)\
**Post date:** [March 14, 2014, 12:36pm UTC](https://discuss.elastic.co/t/max-score-is-not-coming-for-query-with-filter-search/16374/1 "2014-03-14T12:36:17Z")

</div>

Hi,

I'm doing the below query to fetch data date wise. But in the result the  
score is coming as null. How to get the score here.

curl -XPOST "10.203.251.142:9200/aricloud/\_search" -d  
'{  
"query": {  
"filtered": {  
"query" : {  
"match" : {  
"CLOUD\_TYPE" : "AWS-EC2"  
}  
},  
"filter": {  
"range": {  
"NODE\_CREATE\_TIME": {  
"to": "2014-03-14 18:43:55",  
"from": "2014-03-14 16:22:32"  
}  
}  
}  
}  
},  
"sort" : {"NODE\_ID" : "desc"},  
"from" : 0,  
"size" : 3  
}'  
==\>  
{  
"took": 1,  
"timed\_out": false,  
"\_shards": {  
"total": 3,  
"successful": 3,  
"failed": 0  
},  
"hits": {  
"total": 5,  
"max\_score": null,  
"hits": [  
{  
"\_index": "aricloud",  
"\_type": "nodes",  
"\_id": "4",  
"\_score": null,  
"\_source": {  
"NODE\_ID": "12334",  
"CLOUD\_TYPE": "AWS-EC2",  
"NODE\_GROUP\_NAME": "DATABASE",  
"NODE\_CPU": "5GHZ",  
"NODE\_HOSTNAME": "[virtualnode.aricent.com](http://virtualnode.aricent.com)",  
"NODE\_NAME": "aws-node4",  
"NODE\_PRIVATE\_IP\_ADDRESS": "10.123.124.126",  
"NODE\_PUBLIC\_IP\_ADDRESS": "125.31.108.72",  
"NODE\_INSTANCE\_ID": "asw126",  
"NODE\_STATUS": "STOPPED",  
"NODE\_CATEGORY\_ID": "14",  
"NODE\_CREATE\_TIME": "2014-03-14 16:35:35"  
},  
"sort": [  
"12334"  
]  
}  
]  
}  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21f413c0-1a13-4ebf-9a49-d43e3267e46b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21f413c0-1a13-4ebf-9a49-d43e3267e46b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 14, 2014, 12:57pm UTC](https://discuss.elastic.co/t/max-score-is-not-coming-for-query-with-filter-search/16374/2 "2014-03-14T12:57:48Z")

</div>

My first question is: why do you want the score? The score is used only for  
sorting, and you're sorting on NODE\_ID.

If you really want it (and there is a cost to computing the score) then you  
can set track\_scores to true.  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#\_track\_scores](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_track_scores)

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTHAbt0WP9NN\_gJDjDb5%2BvViBs\_ZVn-Zm2KknoX\_dUyCQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTHAbt0WP9NN_gJDjDb5%2BvViBs_ZVn-Zm2KknoX_dUyCQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:43am UTC](https://discuss.elastic.co/t/max-score-is-not-coming-for-query-with-filter-search/16374/3 "2017-07-06T01:43:09Z")

</div>


