Provide an alternative to org.hibernate.search.analyzer.Discriminator for Elasticsearch?
Description
org.hibernate.search.analyzer.Discriminator allows to dynamically choose the analyzer to use on each field based on the value of one entity property. This can't be done on Elasticsearch, as analyzers are defined by the mapping, and cannot be specified when indexing.
Or at the very least, document the lack of support and the fact that it will stay that way. This is currently documented as a temporary limitation as part of HSEARCH-2393.
Note: there are disabled tests that should be re-enabled if we implement this feature or marked as definitively disabled if we decide otherwise. Search for the string HSEARCH-2428 in the codebase.
org.hibernate.search.analyzer.Discriminator
allows to dynamically choose the analyzer to use on each field based on the value of one entity property.This can't be done on Elasticsearch, as analyzers are defined by the mapping, and cannot be specified when indexing.
We should either:
Find a way to implement this (unlikely).
Provide an alternative to Elasticsearch backend users. The Elasticsearch doc advises to use
fields
to address a similar use case: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/multi-fields.html#_multi_fields_with_multiple_analyzers ; seeOr at the very least, document the lack of support and the fact that it will stay that way. This is currently documented as a temporary limitation as part of HSEARCH-2393.
Note: there are disabled tests that should be re-enabled if we implement this feature or marked as definitively disabled if we decide otherwise. Search for the string
HSEARCH-2428
in the codebase.