如何在 ElasticSearch 的 Rest High Level Client 中使用 "has_child"

How to use "has_child" in the Rest High Level Client of ElasticSearch

我想在 ElasticSearch 中发出以下搜索查询。

GET /example1/_search
{
  "query": {
    "has_child": {
      "type": "schedule",
      "query": {
        "bool": {}
      },
      "inner_hits": {},
      "max_children": 10,
      "min_children": 1,
      "score_mode": "min"
    }
  }
}

如何在 Java 的 Rest High Level Client 中编写上述查询?

使用HasChildQueryBuilder.

官方documentation.