Order getting elements from source in query

I'm executing a query with ".../_search?_source=cacheId,expirationTime" and also trying "/_search?_source=expirationTime,cacheId", and the response is always:

( ... ) "_source": {"expirationTime":1558724355237,"cacheId":"96|0hghj56776|13259|"} ( ... )

So, what's the order of the elements within the _source in the response? Because it seems it's not the order requested in the query. It's important for us because we are directly "parsing" the response as string.

You can't have it ordered. You need to read it as a json and not as a string and then do whatever ordering, transformation on your side.

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