# Has\_query type field

**URL:** <https://discuss.elastic.co/t/has-query-type-field/155295>\
**Category:** Elasticsearch\
**Created:** [November 4, 2018, 11:45am UTC](https://discuss.elastic.co/t/has-query-type-field/155295 "2018-11-04T11:45:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![werowe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/werowe/32/47523_2.png) [@werowe](https://discuss.elastic.co/u/werowe)\
**Post date:** [November 4, 2018, 11:45am UTC](https://discuss.elastic.co/t/has-query-type-field/155295/1 "2018-11-04T11:45:41Z")

</div>

I thought ES dropped index types. Below I run a has\_child query and it says it is required. So I add it to the query and then it says it is not allowed.

´´´  
curl -XGET --header 'Content-Type: application/json' [http://parisx:9200/universities/\_search/?pretty=true](http://parisx:9200/universities/_search/?pretty=true) -d '{  
"query": {  
"has\_child" : {  
"query" : {  
"nested": {  
"path": "classes",  
"query": {  
"exists" : { "field" : "grades" }  
}  
}  
}  
}  
}  
}'  
´´´

Gives this error:

> {  
> "error" : {  
> "root\_cause" : [  
> {  
> "type" : "illegal\_argument\_exception",  
> "reason" : "[has\_child] requires 'type' field"  
> }  
> ],  
> "type" : "illegal\_argument\_exception",  
> "reason" : "[has\_child] requires 'type' field"  
> },  
> "status" : 400  
> }

put type in and it says:

> {  
> "error" : {  
> "root\_cause" : [  
> {  
> "type" : "parsing\_exception",  
> "reason" : "[has\_child] query does not support [type:]",  
> "line" : 4,  
> "col" : 22  
> }  
> ],  
> "type" : "parsing\_exception",  
> "reason" : "[has\_child] query does not support [type:]",  
> "line" : 4,  
> "col" : 22  
> },  
> "status" : 400  
> }

---

<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:** [December 2, 2018, 11:45am UTC](https://discuss.elastic.co/t/has-query-type-field/155295/2 "2018-12-02T11:45:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
