# Has\_child query results

**URL:** https://discuss.elastic.co/t/has-child-query-results/40388
**Category:** Elasticsearch
**Created:** [January 28, 2016, 4:37pm UTC](https://discuss.elastic.co/t/has-child-query-results/40388 "2016-01-28T16:37:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![turp1twin](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@turp1twin](https://discuss.elastic.co/u/turp1twin)
#### Post date: [January 28, 2016, 4:37pm UTC](https://discuss.elastic.co/t/has-child-query-results/40388/1 "2016-01-28T16:37:25Z")

</div>

So I am seeing different results when querying for a child document directly and when querying for it with has\_child, and I am not sure why. So my direct query is as follows and returns two documents:

```auto
{
  "query": {
    "nested": {
      "path": "clinvar",
      "query": {
        "match": {
          "clinvar.term": {
            "query": "parkinson disease",
            "operator": "and"
          }
        }
      }
    }
  }
}

```

Now when I run essentially the same query but using has\_child against the parent type as such:

```auto
{
  "query": {
    "has_child": {
        "type": "genomeVariants",
        "query": {
          "nested": {
            "path": "clinvar",
            "query": {
              "match": {
                "clinvar.term": {
                  "query": "parkinson disease",
                  "operator": "and"
                }
              }
            }
          }
        },
        "inner_hits" : {}
      }
  }
}

```

I only get one hit, which is one of the two documents I was expecting. Am I doing something wrong? Any help would be appreciated! Thanks!

Jeff

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/has-child-query-results/40388/2 "2017-07-05T23:20:44Z")

</div>


