Able to annotate @AnalyzerDiscriminator to more than one field.

Description

Today , I found I cannot annotate more than one @AnalyzerDiscriminator in a class.
I feel it is very not intuitive. And it will make the Discriminator implementation more complicated. Because Discriminator will need to more judge field to decide correct analyzer , especially when the two fields are of different types.

Sample1.java

Sample2.java

See the two classes for example.
I cannot add two @AnalyzerDiscriminator in one class , and it throws "Multiple AnalyzerDiscriminator defined in the same class hierarchy" Exception.

So I have to combine LanguageDiscriminator and AnotherDiscriminator into one and use it in the 1st example. And judge Analyzer by field name : 'title' for language analyzer , and 'content' for another analyzer.

but I cannot re-use the 'CombinedDiscriminator' to the 2nd example , because in 2nd example , the 'title' should apply AnotherDiscriminator , not LanguageDiscriminator in 1st example.

So I suggest , a class should be able to apply different Discriminators to different fields. And the Discriminator's methods should be :

It will be more flexible.

Activity

Show:

Yoann Rodière May 11, 2020 at 7:44 AM

See for how to implement similar functionality in Hibernate Search 6.

Yoann Rodière May 11, 2020 at 7:43 AM

No longer relevant: @AnalyzerDiscriminator has been removed in Hibernate Search 6.

Out of Date

Details

Assignee

Reporter

Components

Priority

Created October 19, 2010 at 4:09 PM
Updated May 11, 2020 at 7:44 AM
Resolved May 11, 2020 at 7:43 AM