Script based sorting


(nabizan) #1

hi lets asume that in SQL you select your data with this order

ORDER BY 1000 * round((if (Age>22,(Age-22),(22-Age))+1)/2)-Profil ASC

since im rewriting my search process to elasticsearch and i want to preserve
all functionallity i have to get this right. but im going totally blind here with this
sort order. any help would be really appreciated


(Shay Banon) #2

You can use sort by script (http://www.elasticsearch.org/guide/reference/api/search/sort.html) to get that. But, going in the way of trying to replace an RDBMs functionality with elasticsearch is the wrong way to try and use elasticsearch.
On Thursday, February 17, 2011 at 3:44 PM, nabizan wrote:

hi lets asume that in SQL you select your data with this order

ORDER BY 1000 * round((if (Age>22,(Age-22),(22-Age))+1)/2)-Profil ASC

since im rewriting my search process to elasticsearch and i want to preserve
all functionallity i have to get this right. but im going totally blind here
with this
sort order. any help would be really appreciated

View this message in context: http://elasticsearch-users.115913.n3.nabble.com/script-based-sorting-tp2519175p2519175.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(nabizan) #3

okej but could you help me a little more here? i have no idea how to write this particular script sort ... i have to preserve all the functionality. thanks


(system) #4