zincsearch icon indicating copy to clipboard operation
zincsearch copied to clipboard

Sort values on ES api

Open amirEBD opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. As I wan't to transport my elasticsearch cluster to zinc, having ES compatible API will help alot. Another inconsistency between the Elastic and zinc is Sort values. As Elastic will return the sorted values on responses having the sort field. This can be seen on elasticsearch documentation here . @hengfeiyang

amirEBD avatar Aug 10 '22 12:08 amirEBD

Sample ES output with sort on date and ID fields

Requset curl -X POST -H "Content-Type: application/json" http://localhost:9200/my_index/_search -d '{"query": {"term": {"message": "test"}}, "sort": [{"date": {"order": "desc"}},{"tie_breaker_id": {"order": "desc"}} ]}'

Response { "_index" : "my_index", "_type" : "_doc", "_id" : "YTI2MGM1Y2IwNTUyYzU0NDI3MTczMWIyMGU1MGI4Mzg=", "_score" : null, "_source" : { "tie_breaker_id" : "YTI2MGM1Y2IwNTUyYzU0NDI3MTczMWIyMGU1MGI4Mzg=", "date" : "2022-07-06T12:15:14.978Z", "message" : "test", }, "sort" : [ 1657109714978, "YTI2MGM1Y2IwNTUyYzU0NDI3MTczMWIyMGU1MGI4Mzg=" ] }

amirEBD avatar Aug 10 '22 12:08 amirEBD

We supported most commonly API fro ES, not 100%, and about your question, Maybe need some times to do that.

hengfeiyang avatar Aug 11 '22 07:08 hengfeiyang