Control returned fields sequence


(sumitimes) #1

I have a query like this the output expected is in order of fields specified.
name (String)
price (Double)
year (Integer)

but i am getting
price
year
name

so it is automatically getting sorted to put string last, is there anyway to enforce that i recieve result in same order as whatever is specified in fields

"fields": [
"name",
"price",
"year"
]

Query:
{
"fields": [
"name",
"price",
"year"
],
"from": 10,
"size": 5,
"sort": [],
"filter": {
"query": {
"query_string": {
"query": "/products(name:name)"
}
}
}
}


(system) #2