# (Manually) reordering search results

**URL:** https://discuss.elastic.co/t/manually-reordering-search-results/13730
**Category:** Elasticsearch
**Created:** [September 24, 2013, 5:24am UTC](https://discuss.elastic.co/t/manually-reordering-search-results/13730 "2013-09-24T05:24:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nick\_Lothian](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Nick\_Lothian](https://discuss.elastic.co/u/Nick_Lothian)
#### Post date: [September 24, 2013, 5:24am UTC](https://discuss.elastic.co/t/manually-reordering-search-results/13730/1 "2013-09-24T05:24:57Z")

</div>

Hi

I'm looking for a way to force specific selected documents to rank first  
for a given query.

Is there a simple way to do this?

If not, what is the best complicated approach to take?

It seems like it might be possible to do this using native script fields.  
I'm very new to Elasticsearch, and I don't completely understand script  
fields - if you have a script field doesn't it mean that script has to be  
executed for every single document in the index for every query? That  
doesn't seem very performant for anything but the smallest index. What am I  
missing there?

Nick

--  
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: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [September 25, 2013, 12:43am UTC](https://discuss.elastic.co/t/manually-reordering-search-results/13730/2 "2013-09-25T00:43:29Z")

</div>

If you know the documents ids, you can have a bool query with one of the  
clauses being a term query on that document id with a very high boost.

Have you looked into the rescore functionality? You can limit the scoring  
on only the top n documents.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--  
Ivan

On Mon, Sep 23, 2013 at 10:24 PM, Nick Lothian [nick.lothian@gmail.com](mailto:nick.lothian@gmail.com)wrote:

> Hi
> 
> I'm looking for a way to force specific selected documents to rank first  
> for a given query.
> 
> Is there a simple way to do this?
> 
> If not, what is the best complicated approach to take?
> 
> It seems like it might be possible to do this using native script fields.  
> I'm very new to Elasticsearch, and I don't completely understand script  
> fields - if you have a script field doesn't it mean that script has to be  
> executed for every single document in the index for every query? That  
> doesn't seem very performant for anything but the smallest index. What am I  
> missing there?
> 
> Nick
> 
> --  
> 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).

--  
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:14am UTC](https://discuss.elastic.co/t/manually-reordering-search-results/13730/3 "2017-07-06T02:14:48Z")

</div>


