Nested object in sort

Hello, I'm trying to write in c# using Nest 6.0 version code provided here: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html

POST /_search
{
   "query" : {
      "term" : { "product" : "chocolate" }
   },
   "sort" : [
       {
          "offer.price" : {
             "mode" :  "avg",
             "order" : "asc",
             "nested": {
                "path": "offer",
                "filter": {
                   "term" : { "offer.color" : "blue" }
                }
             }
          }
       }
    ]
}

How can write this nested object in c#?
The only thing that I found in the library for the SortDescriptor object is NestedPath() and NestedFilter(), unfortunatelly both of them are deprecated:

#! Deprecation: [nested_path] has been deprecated in favor of the [nested] parameter
#! Deprecation: [nested_filter] has been deprecated in favour for the [nested] parameter

1 Like

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