Trigger/Set analyzer in classbridge

Description

Referencing the discussion here
https://forum.hibernate.org/viewtopic.php?f=9&t=1016667&p=2468462#p2468462

I think it might be useful to allow you to trigger a custom analyzer in a class- or fieldbridge. This would allow you to select appropriate analyzers for any custom field within a bridge. This would probably usually be a classbridge.

I can see a few ways to do this:
1. Add a setAnalyzer method to the luceneOptions element. This would prevent interface changes.
2. Implement a new interface AnalyzerBridge that offers a setAnalyzer method.
3. Implement a new interface AnalyzerSelectBridge that allows you to select a predefined analyzer.

Environment

None

Activity

Show:
Marc Schipperheyn
April 14, 2013, 3:50 PM

Even if one selects a discriminator at the classbridge level it would have to be applicable at a field level. I just realized that by using the luceneOptions.addFieldToDocument could be used for this by adding an overriden method
luceneOptions.addFieldToDocument(String fieldName, String indexedString, Document document, String analyzerDefinition)

Yoann Rodière
May 27, 2020, 8:35 AM

Was solved in Hibernate Search 6 some time ago. You can define every field very precisely in a TypeBridge, including the analyzer.

Assignee

Yoann Rodière

Reporter

Marc Schipperheyn

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Minor
Configure