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

Time:09-17

I want to issue the following search query in ElasticSearch.

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

How do I write the above query in the Rest High Level Client in Java?

CodePudding user response:

Use HasChildQueryBuilder.

Official documentation.

  • Related