-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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.