use of org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilterFactory in project lucene-solr by apache.
the class MultiTermTest method testMultiFound.
@Test
public void testMultiFound() {
SchemaField field = h.getCore().getLatestSchema().getField("content_multi");
Analyzer analyzer = ((TextField) field.getType()).getMultiTermAnalyzer();
assertTrue(analyzer instanceof TokenizerChain);
assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof WhitespaceTokenizerFactory);
TokenizerChain tc = (TokenizerChain) analyzer;
for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
assertTrue((factory instanceof ASCIIFoldingFilterFactory) || (factory instanceof LowerCaseFilterFactory));
}
analyzer = field.getType().getIndexAnalyzer();
assertTrue(analyzer instanceof TokenizerChain);
assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof WhitespaceTokenizerFactory);
tc = (TokenizerChain) analyzer;
for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
assertTrue((factory instanceof ASCIIFoldingFilterFactory) || (factory instanceof TrimFilterFactory));
}
assertTrue(tc.getCharFilterFactories().length == 0);
}
use of org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilterFactory in project lucene-solr by apache.
the class MultiTermTest method testDefaultCopiedToMulti.
@Test
public void testDefaultCopiedToMulti() {
SchemaField field = h.getCore().getLatestSchema().getField("content_ws");
Analyzer analyzer = ((TextField) field.getType()).getMultiTermAnalyzer();
assertTrue(analyzer instanceof TokenizerChain);
assertTrue(((TokenizerChain) analyzer).getTokenizerFactory() instanceof KeywordTokenizerFactory);
TokenizerChain tc = (TokenizerChain) analyzer;
for (TokenFilterFactory factory : tc.getTokenFilterFactories()) {
assertTrue((factory instanceof ASCIIFoldingFilterFactory) || (factory instanceof LowerCaseFilterFactory));
}
assertTrue(tc.getCharFilterFactories().length == 0);
}
Aggregations