Allow per-index analyzer definitions in Elasticsearch

Description

Follows up on and : when using the Elasticsearch backend, allow to configure an index-specific analysis definition provider.

This is especially important because analyzer definitions are pushed to Elasticsearch on a per-index basis. If analyzer definitions are registered globally in Hibernate Search (as we do currently), we end up with two solutions, both dodgy:

  1. Either we push all definitions to every ES index, and risk unnecessary updates of the indexes, because some definitions are actually never used for some indexes.

  2. Or we push to each index only the analyzer definitions that are referenced from a field definition, and risk "forgetting" some definitions that are only used at query time.

Making (at least some) analyzer definitions index-scoped solves the problem: we can decide to push all the global definitions to every index, and the index-scoped definitions only to the index they are assigned to. This gives the user complete control over which definitions should be pushed to the each ES index.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Fix versions

Priority

Major
Configure