Hibernate Search 6 Index Aliases

Regarding the name field; you are correct, the annotation is wrong in this case, I will fix this on my side.

When you query the field name through Hibernate Search APIs

I’m mostly using native only querying, so not sure if this applies.

Since the name field is analyzed anyway, I would recommend simply removing field.analyzed and putting the analyzer on name ?

I cannot do this has I am using both the name and name.analyzed for better results when searching my documents by name.

Regarding the dates; the dates formats the Elasticsearch expects by default are well known.

Date formats can be customised, but if no format is specified then it uses the default:

“strict_date_optional_time||epoch_millis”

If the value is strict_date_optional_time||epoch_millis, then why not default to ISO-8601 formatted strings for persistence and parsing? That is how I’ve done it in the past and we’ve persisted many of the different Java time object structures. Elasticsearch used to use JodaTime under the covers. I think they may have switched over to new standard Java time in newer versions. Even as such, if the value in the mapping is “strict_date_optional_time||epoch_millis” I would think we would know the expected formats. Then again, I’m not aware of the specifics of the frameworks needs.