Does Nest support sorting on multiple fields? For example, say I want to sort first by FieldA ascending and then by FieldB descending.
My current approach looks some
for sorting on multiple dynamic fields, SortDescriptor can be useful.
var sortDescriptor = new SortDescriptor<{YourType}>();
sortDescriptor.Field(f => f.YourFieldName, Nest.SortOrder.Ascending);
// If Field Name is Dynamic
sortDescriptor.Field(
"someOtherFieldName",
Nest.SortOrder.Descending);
var searchResponse = await client.SearchAsync<{YourType}>(x => x
.Query(y => query)
.Sort(s => sortDescriptor)
.From(from)
.Size(size)
);