ExAliyunOts.Search.nested_filter

You're seeing just the function nested_filter, go back to ExAliyunOts.Search module for more information.
Link to this function

nested_filter(path, filter)

View Source

Specs

nested_filter(path :: String.t(), filter :: map()) :: map()

Use for the nested type field in field_sort/2 as :nested_filter option, the input filter is a Query to filter results.

Example

import MyApp.TableStore

search "table", "index_name",
  search_query: [
    query: nested_query(
      "content",
      [
        exists_query("content.header")
      ]
    ),
    sort: [
      field_sort("content.header",
        order: :desc,
        nested_filter: nested_filter(
          "content",
          prefix_query("content.header", "header")
        )
      )
    ]
  ]

Please ensure that the query criteria matched will participate in sorting, if there exists any not matched case will lead to uncertainty of sorting results.