jeudi 29 octobre 2015

How to search multiple generations in Elasticsearch

Elasticsearch's article outlines how to find objects based on a search through one generation: http://ift.tt/1FanGXd

GET /company/country/_search
{
  "query": {
    "has_child": {
      "type": "branch",
      "query": {
        "has_child": {
          "type": "employee",
          "query": {
            "match": {
              "hobby": "hiking"
            }
          }
        }
      }
    }
  }
}

What if I want to also want to query the branch for the name starting with "liverpool"? How do you modify this search to find that? I keep getting format errors and I can't seem to find information about how nest the queries online.

Aucun commentaire:

Enregistrer un commentaire