How to customize sorting by elasticsearch

es version 2.4

data stores an int field with the following meaning

When

is 0, it means that there is no ranking
is 1, meaning that the first place is
is n (n > 0), the meaning is ranked n

ranking from high to low is in the order of 1Mui-> 2Mel-> 3->.--> NMUE-> 0
when ranking from low to high, the order is 0Mui-> NMUE->.--> 3MUE-> 2MUE-> 1

.

how does es achieve the above sort?
I am not familiar with es. I can only think of a stupid method, that is, inter-partition search, where 0 is an interval, > 0 is an interval, and when insufficient, take

from another interval.
Aug.14,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eba500-69f35.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eba500-69f35.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?