According to this documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/enabled.html it's possible to disable parsing of the object, but I don't see any mapping option for that in @Field
.
I had to use this dirty hack (after indexOperations.createMapping()
):
(Map<String, Object>) ((Map) document.get("properties")).get("myObjectField")).put("enabled", false);
Is there any better way to do that? I don't want to use mapping files.
That one is missing as parameter of the @Field
annotation, you're right.
I created an issue for that, will try to get to it this evening to have it in the next version.
And no, up to that, there is no other way besides mapping files or your solution (which only works, if you don't have automatic index creation disabled, otherwise the repository setup will create the index and mapping)
Edit 09.10.2020: will be included from version 4.1.RC2 on