# Has\_child query inside multitype search

**URL:** <https://discuss.elastic.co/t/has-child-query-inside-multitype-search/22155>\
**Category:** Elasticsearch\
**Created:** [February 13, 2015, 4:29pm UTC](https://discuss.elastic.co/t/has-child-query-inside-multitype-search/22155 "2015-02-13T16:29:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_silva/32/907_2.png) [@Daniel\_Silva](https://discuss.elastic.co/u/Daniel_Silva)\
**Post date:** [February 13, 2015, 4:29pm UTC](https://discuss.elastic.co/t/has-child-query-inside-multitype-search/22155/1 "2015-02-13T16:29:58Z")

</div>

Hi,

I have one type _File_ that has a child _Content_, and there is another  
type \*Question \*without any child mapping.

I'm trying to search inside the two types with the following query:

```
    {"query": 
              {
                "bool": {
                  "should": [
                          {
                            "term": {
                              "file.name": { "value": "my query" }
                            }
                          },
                          {
                            "term": {
                              "question.title": { "value": "my query" }
                            }
                          },
                          {
                            "has_child": {
                              "type": "content",
                              "query": {
                                "match": {
                                  "content": {
                                    "type": "phrase",
                                    "query": "my query",
                                    "slop": 3,
                                    "boost": 2.0
                                  }
                                }
                              }
                            }
                          }
                        ]
                      }
                    }
                  }

```

But Elasticsearch throws the exception: _nested:  
QueryParsingException[[question] [has\_child] No mapping for for type  
[content]]_

I thought that the has\_child query would just score File docs and ignore  
Question docs. Is it possible to do this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9e8c3369-2464-43ce-beca-f1775aecbbbb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9e8c3369-2464-43ce-beca-f1775aecbbbb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:32am UTC](https://discuss.elastic.co/t/has-child-query-inside-multitype-search/22155/2 "2017-07-06T00:32:54Z")

</div>

Closed on July 6, 2017, 12:32am UTC


