NEST SortScriptDescriptor class

Hi guys,

I was using the "SortScriptDescriptor" class in this part of a c# app:

                    SortScriptDescriptor<dynamic> sortScriptDescriptor = new SortScriptDescriptor<dynamic>();
                    if (sortItem.Dir == "asc")
                    {
                        sortScriptDescriptor.Ascending();
                    }
                    else
                    {
                        sortScriptDescriptor.Descending();
                    }
                        var mgFieldList = Schema.GetDimensions(indexGroup, measureGroup, null, null);
                        var parsedField = ScriptGenerator.GetAggregationScript(mgField.Expression, mgFieldList.Values.ToList());
                        var scriptSortType = mgField.FieldType.Contains("String") ? "string" : "number";
                        sortDescriptor.Script(s => sortScriptDescriptor.Type(scriptSortType).Script(scr => scr.Source(parsedField.ElasticScript)));

Since this class was deleted in NEST 7... what would be its replacement?

Thanks

FYI this works:

                    sortDescriptor.Script(s => 
                                             (sortItem.Dir.ToLower() == "asc" ? 
                                                       s.Ascending().Script(s => s.Source(parsedField.ElasticScript)) : 
                                                       s.Descending().Script(s => s.Source(parsedField.ElasticScript))
                                          ));
                }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.