I have my question on stackoverflow at http://stackoverflow.com/questions/38091130/inner-hit-definition-with-the-name-typename-already-exists-use-a-different-in but for completeness I will put the details of my query here also.
I have had a search query with the following payload
"query": {
"filtered": {
"filter": {
"and": [
{
"range": {
"@timestamp": {
"gte": "2015-01-01||/d",
"lte": "2016-01-01||/d"
}
}
},
{
"or": [
{
"has_child": {
"type": "TypeName",
"filter": {
"term": {
"eventType.raw": "some-event"
}
},
"inner_hits": {
"_source": "@timestamp"
}
}
},
{
"not": {
"has_child": {
"type": "TypeName",
"filter": {
"term": {
"eventType.raw": "some-event"
}
},
"inner_hits": {
"_source": "@timestamp"
}
}
}
}
]
}
]
}
}
}
and this was working fine with elasticsearch 1.7 but with the latest stable version 2.3.3 of elasticsearch it does not quite work and fails with the following response
"reason": {
"type": "illegal_argument_exception",
"reason": "inner_hit definition with the name [TypeName] already exists. Use a different inner_hit name"
}
Any idea what could have gone wrong here?