Terms query not working with nested documents


I am using JAVA API to implement elasticsearch.

I have a nested document in my index. I am trying to perform a terms query on that nested document. But It doesn't give any results.

When I googled it I found the below solution.

When I tried to do "include_in_root": true as shown in the above solution I am getting the below exception.

reason=The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true.

Is there is any way that I can query the nested documents using terms query.


I hope you are making use of Elastic search 7.0 and Nest C# lastest version. There are some breaking changes with ES 7.0 which is causing this issue.

Please go through this link for fixing it. This is basically caused by ES7.0 version which removed doctype

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