1

I am trying to write sorting on multiple fields after performing bucketing aggregation. When I upgraded to Nest 6.0.0.0 C# I am getting an error saying that the following I need to convert my descriptor to IPromise. I am not exactly sure how to provide this input. My function snippet is something like this :

   var sortList = new List();
   foreach (SortCriteria sc in sortCriterias) {

    switch (sc.SortMode) {
       case SortMode.Asc:
             sortList.Add(new SortField { Field = "Test", Order = SortOrder.Ascending });
          break;
       case SortMode.Desc:
             sortList.Add(new SortField { Field = "Test2", Order = SortOrder.Descending });
          break;
    }
 }
 return sortList; --> Somehow I need to convert this list to IPromise<IList<ISort>>
Rob
  • 9,664
  • 3
  • 41
  • 43
developer_ak
  • 165
  • 1
  • 7
  • Could you provide more context to the code snippet you have? It'll help in understanding what API method is being called. You may need an `IPromise` implementation, similar to that in https://stackoverflow.com/a/49427291/1831 – Russ Cam Mar 22 '18 at 11:20
  • Hello Russ, I re-looked into my problem again and it seems that we cannot sort on aggregations using multiple fields. So basically i was using terms aggregations and then trying to sort using multiple fields. But it seems that only one sorting can take place. – developer_ak Mar 26 '18 at 08:05

0 Answers0