Rank search query results based on master list ranking

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

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