Skip to content

SearchDescriptor doesn't allow creating a list of sorts #804

@johndaniels

Description

@johndaniels

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions