My doc:
{"local_id" : 1654,
"universal_id" : 5412896
}
{
"local_id" : 1657,
"universal_id" : 9658742
}
{
"local_id" : 1658,
"universal_id" : 6325412
}
My query :
{"from": 0, "size": 10,"query": {
"bool": {
"must" : [{
"terms": {
"universal_id": [ 6325412, 5412896, 5412896]
}}]}}}
My Actual result:
"hits" : [
{
"_source" : {
"local_id" : 1654,
"universal_id" : 5412896
}
},
{
"_source" : {
"local_id" : 1658,
"universal_id" : 6325412
}
}
]
But I need result as below in my querying order ,
My Expected result:
{
"_source" : {
"local_id" : 1658,
"universal_id" : 6325412
}
},
{
"_source" : {
"local_id" : 1658,
"universal_id" : 6325412
}
},
{
"_source" : {
"local_id" : 1654,
"universal_id" : 5412896
}
}
]
How to achieve this in elasticsearch?