ExAliyunOts.Search.nested_query

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

nested_query(path, query, options \\ [])

View Source

Specs

nested_query(path :: String.t(), query :: map() | Keyword.t(), options()) ::
  map()

Use NestedQuery as the nested :query option of :search_query option in ExAliyunOts.search/4, the target field need to be a nested type, it is used to query sub documents of nested type.

Official document in Chinese | English

Example

import MyApp.TableStore

search "table", "index_name",
  search_query: [
    query: nested_query(
      "content",
      term_query("content.header", "header1")
    )
  ]

Options

  • :score_mode, available options have :none | :avg | :max | :total | :min, by default it's :none.