# Rescore and track\_scores

**URL:** <https://discuss.elastic.co/t/rescore-and-track-scores/11871>\
**Category:** Elasticsearch\
**Created:** [May 8, 2013, 6:29am UTC](https://discuss.elastic.co/t/rescore-and-track-scores/11871 "2013-05-08T06:29:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meidan](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Meidan](https://discuss.elastic.co/u/Meidan)\
**Post date:** [May 8, 2013, 6:29am UTC](https://discuss.elastic.co/t/rescore-and-track-scores/11871/1 "2013-05-08T06:29:17Z")

</div>

Hi,

Has anyone been able to use query rescoring and sort by a field other then  
the score?  
Whenever I add the sort, I get a constant score of 1 to all documents, even  
when adding track\_scores.

Thanks.

--  
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:** ![Tzvi\_Gregory\_Kaidano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tzvi_gregory_kaidano/32/1302_2.png) [@Tzvi\_Gregory\_Kaidano](https://discuss.elastic.co/u/Tzvi_Gregory_Kaidano)\
**Post date:** [July 28, 2014, 10:40am UTC](https://discuss.elastic.co/t/rescore-and-track-scores/11871/2 "2014-07-28T10:40:22Z")

</div>

Did you get answer for your question?  
I found alternatives that I add to my post but we need to use sort  
especially with rescore..  
Is there a way to make it happen?

Also, one very important thing – rescoring cannot be combined with sorting,  
because sorting is done after changes introduced by rescoring.  
[http://elasticsearchserverbook.com/elasticsearch-0-90-using-rescore/](http://elasticsearchserverbook.com/elasticsearch-0-90-using-rescore/)

[http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/](http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/)  
But if you have different document types, you may need to make some manual  
adjustments. For example, we index both articles and videos. Articles have  
a lot of textual content — the entire body of the article — but videos only  
have a short description field. By default Lucene will prefer a match in a  
shorter field, so when videos match they tend to score higher than articles.

[http://grokbase.com/t/gg/elasticsearch/135ps9t41p/boosting-based-on-a-child-documents-field](http://grokbase.com/t/gg/elasticsearch/135ps9t41p/boosting-based-on-a-child-documents-field)

set metadat to documents types and then use the the script "script":  
"\_score \* doc['rating'].value" to get the score .

On Wednesday, May 8, 2013 9:29:17 AM UTC+3, Meidan wrote:

> Hi,
> 
> Has anyone been able to use query rescoring and sort by a field other then  
> the score?  
> Whenever I add the sort, I get a constant score of 1 to all documents,  
> even when adding track\_scores.
> 
> Thanks.

--  
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/02346858-9665-4fab-8614-aabbbe38a256%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/02346858-9665-4fab-8614-aabbbe38a256%40googlegroups.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:12am UTC](https://discuss.elastic.co/t/rescore-and-track-scores/11871/3 "2017-07-06T01:12:50Z")

</div>


