How to avoid "_class" field in documents using spring-data-elasticsearch

Viewed 1158

I am using spring-data-elasticsearch for my application. I found spring automatically creates dynamic field "_class" in all my documents. I configured my index as a strict dynmaic mapping. I expecting some properties to exclude this field from my document/mapping dynamically.

Is there any way to do this?

1 Answers

Currently this can not be deactivated. There is an open issue to add this behaviour.

But from the next version on (4.2.0.M5) the _class property will be defined in the index mapping when the index and its mapping are created by Spring Data Elasticsearch issue #1711.

Related