Has_query type field

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 -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
}

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