Im trying to find and sort the values in a customized way
search term - "tamil"
below is the desired result sort order
tamila
tamilba
tamilbd
tamilc
atamil
bcctamil
oootamilh
vtamil
wstamil
mapping:
"column name": {
"type": "string",
"index_options": "offsets"
}
query used:
POST content_es/_search
{
"query": {
"function_score": {
"query": {
"match": {
"content": "tamil"
}
},
"script_score": {
"script": "termInfo=_index['content'].get('tamil',_OFFSETS);for(pos in termInfo){return pos.startOffset};"
},
"boost_mode": "replace"
}
},
"sort": [{ "_score": "asc" } ]
}
But the above is not working.
Can someone please share your vision on this scenario?
Thanks in Advance!!!