# Search result scoring

**URL:** https://discuss.elastic.co/t/search-result-scoring/156494
**Category:** Elasticsearch
**Created:** [November 13, 2018, 2:38pm UTC](https://discuss.elastic.co/t/search-result-scoring/156494 "2018-11-13T14:38:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![atom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atom/32/34758_2.png) [@atom](https://discuss.elastic.co/u/atom)
#### Post date: [November 13, 2018, 2:38pm UTC](https://discuss.elastic.co/t/search-result-scoring/156494/1 "2018-11-13T14:38:24Z")

</div>

Hi,

i have question about search result order in elasticsearch.  
We have different sort rules and a method for score calculation that works fine so far.

Lets assume we are performing a search and getting 10,000 results back. I want to change the query, so that the result (document) with the id=1003041 will always be shown on the result page on position 2. No matter, what score it gets.

What would be the "elastic-way" of doing this?

---

<div class="post-metadata">

### Author: ![softwaredoug](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/softwaredoug/32/22681_2.png) [@softwaredoug](https://discuss.elastic.co/u/softwaredoug)
#### Post date: [November 14, 2018, 1:57am UTC](https://discuss.elastic.co/t/search-result-scoring/156494/2 "2018-11-14T01:57:37Z")

</div>

One way might be to change the sort to use more than the score. In other words to sort in the following order

- First - Some script that assigns a 1 to the doc you want in the 2nd position - returns 1 if the id you want for that slot, 0 otherwise

- Second - Score

Then when rendering the results put the item returned first from ES into the 2nd position on the UI

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html)

-Doug

---

<div class="post-metadata">

### Author: ![atom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atom/32/34758_2.png) [@atom](https://discuss.elastic.co/u/atom)
#### Post date: [November 14, 2018, 6:44pm UTC](https://discuss.elastic.co/t/search-result-scoring/156494/3 "2018-11-14T18:44:54Z")

</div>

Hi Doug,

maybe i have expressed unfavourable. What i meant was, that i want the possiblity to pin any result to anywhere i want. Position 2 was just an example. Lets say, i want to show result 50 at position 2 and result 91 at position 8. But the rest should be sorted like how elastic returns the list. This is just an example. What i really want is just a possibility to show some results at a specific position i can choose.  
Is there something already implemented in elastic or do i need to do it manually in my php code?

---

<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: [December 12, 2018, 6:50pm UTC](https://discuss.elastic.co/t/search-result-scoring/156494/4 "2018-12-12T18:50:33Z")

</div>

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