Hi,
Could I please ask for advice about instantiation of Analyzers (for hibernate search).
1) I wanted to invoke the parametrized constructor: new SnowballAnalyzer(version, name).
I couldn't find an elegant way to do it...
@Analyzer(impl=classname) doesn't receive constructor parameters.
@AnalyzerDef works, but the examples I see are cumbersome:
Code:
@AnalyzerDefname="englishSnowball",tokenizer =
@TokenizerDef(factory = StandardTokenizerFactory.class ),
filters = {@TokenFilterDef(factory=StandardFilterFactory.class),
@TokenFilterDef(factory=LowerCaseFilterFactory.class),
@TokenFilterDef(factory = StopFilterFactory.class...
@TokenFilterDef(factory = SnowballPorterFilterFactory.class,
params = @Parameter(name="language", value="English") )
While I just wanted simple the defaults of SnowballAnalyzer... Is there no elegant way for hibernate search to invoke a parametrized constructor?
Of course I can wrap SnowballAnalyzer with my own Analyzer, with no-arg consturctor... but it's not elegant.
2) If I do settle for @AnalyzerDef, does it have be be declared on a specific Entity?
What if I want this analyzer to be shared for all entities?
Thanks very much :)