_source sorting while retrieving the data from es

hi if iam a query like this

query = {"query":{"bool":{"must":[{
            "range":{
                "timestamp":{
                    from_time_key:from_time,
                    to_time_key:to_time
                    }
                }
            }
            ]}},"_source":["timestamp","host","program","severity","severity_code","facility","facility_code","pri","tag","message"]}

iam getting the data but not in the order which i have given in the source field , how can i sort it according to the format which i have given above

JSON is not an ordered data structure, so there's no way to do that sorry.

ok cool

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.