# Rank search query results based on master list ranking

**URL:** <https://discuss.elastic.co/t/rank-search-query-results-based-on-master-list-ranking/124300>\
**Category:** Elasticsearch\
**Created:** [March 16, 2018, 1:23pm UTC](https://discuss.elastic.co/t/rank-search-query-results-based-on-master-list-ranking/124300 "2018-03-16T13:23:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rougui](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@Rougui](https://discuss.elastic.co/u/Rougui)\
**Post date:** [March 16, 2018, 1:23pm UTC](https://discuss.elastic.co/t/rank-search-query-results-based-on-master-list-ranking/124300/1 "2018-03-16T13:23:17Z")

</div>

Hi,

I am a beginner with ElasticSearch.

I am developing mobile application with Elasticsearch as this scheme:

```
FrontEnd BackEnd
Mobile application <---> Firebase cloud function <---> elasticsearch database

```

I already made the BackEnd logic that builds the main and search lists, that will be loaded on application side.

now I'm facing this situation :

Application complete list:

```
**RankN° PersonName Score**
1 AAAA-aaa 2500
2 AAAA-aaa 2000
3 BBBB-bbb 1000 
4 BBBB-xxxx 500 
4 CCCC-cccc 400
5 DDDD-ddd 300

```

When user search for example BBBB i want that my search query return :

```
**Rank N° PersonName Score**
3 BBBB-bbb 1000 
4 BBBB-xxxx 500 

```

insteadof

```
**Rank N° PersonName Score**
1 BBBB-bbb 1000 
2 BBBB-xxxx 500 

```

My solution this time is to update RankN° each time complete list requested. Like that i will able keeping same rank in search results.

My question is : is there a more optimal way with elasticsearch to do that ?

Thanks

---

<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:** [April 13, 2018, 1:23pm UTC](https://discuss.elastic.co/t/rank-search-query-results-based-on-master-list-ranking/124300/2 "2018-04-13T13:23:22Z")

</div>

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