How can I put selected items on top of results? For example I want id 3 and 4 on top after sort by name. Similar to SQL Order in query.
Let's say I have an index call person.
GET person/_search
{
hits: [
"_source" : {
"id" : 1,
"name" : "Paul"
},
"_source" : {
"id" : 2,
"name" : “Mike”
},
"_source" : {
"id" : 3,
"name" : “Alex”
},
"_source" : {
"id" : 4,
"name" : “Susan”
}
]
}
My current search query:
{ "track_total_hits": true,
"from" : 0,
"size" : 30,
"query":{
"query_string":
{
"query": " some query matchin"
}
}, "sort" :
[
{"nae" : {"order" : "desc"}}
] }}