use of org.apache.lucene.analysis.util.StopwordAnalyzerBase in project orientdb by orientechnologies.
the class OLuceneAnalyzerFactoryTest method shouldAssignConfiguredAnalyzerForIndexing.
@Test
public void shouldAssignConfiguredAnalyzerForIndexing() throws Exception {
OLucenePerFieldAnalyzerWrapper analyzer = (OLucenePerFieldAnalyzerWrapper) analyzerFactory.createAnalyzer(indexDef, INDEX, metadata);
assertThat(analyzer.getWrappedAnalyzer("title")).isInstanceOf(EnglishAnalyzer.class);
assertThat(analyzer.getWrappedAnalyzer("author")).isInstanceOf(KeywordAnalyzer.class);
assertThat(analyzer.getWrappedAnalyzer("lyrics")).isInstanceOf(EnglishAnalyzer.class);
assertThat(analyzer.getWrappedAnalyzer("description")).isInstanceOf(StandardAnalyzer.class);
StopwordAnalyzerBase description = (StopwordAnalyzerBase) analyzer.getWrappedAnalyzer("description");
assertThat(description.getStopwordSet()).isNotEmpty();
assertThat(description.getStopwordSet()).hasSize(2);
assertThat(description.getStopwordSet().contains("the")).isTrue();
assertThat(description.getStopwordSet().contains("is")).isTrue();
}
Aggregations