You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, SearchDescriptor should add items to a list and serialize as such, which would preserve the order of any sorts applied in the descriptor. As far as I can tell the current scheme only works because .NET serializes dictionary entries in the order they were added, and ElasticSearch honors that order as well, but that doesn't seem like a good thing to rely on.
The text was updated successfully, but these errors were encountered:
Hey @johndaniels, you are absolutely right- this was a great find. I've opened the above PR #807 which addresses this. Sort() now adds to a list of key/value pairs and serializes to a json array. Thanks for reporting!
Adding sorts to the SearchDescriptor using .Sort() adds more key/value pairs to a dictionary, whereas the API specification at https://github.com/elasticsearch/elasticsearch/blob/master/rest-api-spec/api/search.json#L96 and the Elasticsearch documentation at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html indicates that sort is supposed to be a list of sorts.
Ideally, SearchDescriptor should add items to a list and serialize as such, which would preserve the order of any sorts applied in the descriptor. As far as I can tell the current scheme only works because .NET serializes dictionary entries in the order they were added, and ElasticSearch honors that order as well, but that doesn't seem like a good thing to rely on.
The text was updated successfully, but these errors were encountered: