i'm doing sending queries to elasticsearch and it responde with an unknown order of fields in its documents. how can i fix the order that elsasticsearch is returning fields inside documents? i mean, i'm sending this query:
{
"index": "my_index",
"_source":{
"includes" : ["field1","field2","field3","field14"]
},
"size": X,
"body": {
"query": {
// stuff
}
}
}
and when it responds, it gives me something not in the good order. i ultimatly want to convert this to csv, and want to fix csv headers. is there something to do so i can get something like doc1 :{"field1","field2","field3","field14"} doc2 :{"field1","field2","field3","field14"} ... in the same order as my "_source" ?
thank's for your help.