Hi,
I’m integrating Hibernate Search in my project which previously used Spring Data Elasticsearch. It annoys me that it’s required to place @Field annotations everywhere: most of the fields in my entities need to be indexed, so it would be more convenient to index everything by default and have some @Ignore annotation to exclude unnecessary fields. Is it possible to configure that? Something like a class bridge or a custom analyzer?
Also, most of the indexed String fields need to be mapped as keywords. In order to do so, I have to use @Field(analyze = NO), but I wonder if there’s a way to configure that as a default too. I’ve tried to use a custom field bridge provider for String types, but it seems that Hibernate Search doesn’t allow to override builtin providers.
Thanks,
Sandeep, Elasticsearch Developer
There’s no automatic way to index all the fields of an entity because, usually, you have to do some fine tuning of what is indexed, which analyzer should be used, should you mark an association with @IndexedEmbedded and so on.