Skip to content

Normalize Sort in 2.0 #1311

@Mpdreamz

Description

@Mpdreamz

Sort() on SearchDescriptor works in an unexpected way: you can call it multiple times and mutate SearchDescriptor's state. Where everywhere else chaining the same method twice will override the previous value in a descriptors state.

Proposal change from:

client.Search<T>(s=>s
    .Sort()
    .SortScript()
)

to

client.Search<T>(s=>s
    .Sort(sort=>sort
          .Ascending()
          .Descending()
          .ScriptDescending()
         ....
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions