use of org.apache.lucene.analysis.en.EnglishAnalyzer in project orientdb by orientechnologies.
the class OLucenePerFieldAnalyzerWrapperTest method shouldReturnCustomAnalyzerForEachFieldInitializedByConstructor.
@Test
public void shouldReturnCustomAnalyzerForEachFieldInitializedByConstructor() throws Exception {
OLucenePerFieldAnalyzerWrapper analyzer = new OLucenePerFieldAnalyzerWrapper(new StandardAnalyzer(), new HashMap<String, Analyzer>() {
{
put("text_en", new EnglishAnalyzer());
put("text_it", new ItalianAnalyzer());
}
});
assertThat(analyzer.getWrappedAnalyzer("text_en")).isNotNull();
assertThat(analyzer.getWrappedAnalyzer("text_en")).isInstanceOf(EnglishAnalyzer.class);
assertThat(analyzer.getWrappedAnalyzer("text_it")).isNotNull();
assertThat(analyzer.getWrappedAnalyzer("text_it")).isInstanceOf(ItalianAnalyzer.class);
}
Aggregations