I am using Elasticsearch 5.1.1. While doing a nested query, it is returning 400 Error
My Doc will look like this
{
"_index" : "test",
"_type" : "test_five",
"_source" : {
"doc" : {
"keyword_elas" : "elasticsearch",
}
},
"doc_as_upsert" : true }
This is my Query Code
{
"query": {
"nested": {
"path":"_source",
"query": {
"nested": {
"path": "_source.doc",
"query": {
"match": {
"_source.doc.keyword_elas": "elasticsearch"
}
}
}
}
}
}}
For the above Query i got an exception
elasticsearch.exceptions.RequestError: TransportError(400, u'search_phase_execution_exception', u'failed to create query: {\n "nested" : {\n "query" : {\n "nested" : {\n
Is this an exception due to some Query Mistake ? or any Version problem...
Thank You
reason
property which told me I failed to create the nested type properly (when setting up my mappings): "caused_by": { "type": "illegal_state_exception", "reason": "[nested] nested object under path [comments] is not of nested type" } – The Red Pea