Hi,
Even though Hibernate Search constructs a so called
ScopedAnalyzer for each entity containing a hashmap of analyzers there is currently no way to get hold of this class and it also does not have a public API to access this map.
Have a look at Lucene's
PerFieldAnalyzerWrapper. This class allows you to wrap multiple analyzers into a single class. You could implement your own instance of this class and set it on class level:
Code:
...
@Entity
@Indexed
@Analyzer(impl = foo.bar.MyPerFieldAnalyzerWrapper.class)
public class MyClass {
...
You could even define a global analyzer which handles even fields across multiple entities. I've used this approach multiple times and was quite happy with it.
--Hardy