Search in sources :

Example 1 with FingerprintFilter

use of org.apache.lucene.analysis.miscellaneous.FingerprintFilter in project elasticsearch by elastic.

the class FingerprintTokenFilterFactory method create.

@Override
public TokenStream create(TokenStream tokenStream) {
    TokenStream result = tokenStream;
    result = new FingerprintFilter(result, maxOutputSize, separator);
    return result;
}
Also used : FingerprintFilter(org.apache.lucene.analysis.miscellaneous.FingerprintFilter) TokenStream(org.apache.lucene.analysis.TokenStream)

Example 2 with FingerprintFilter

use of org.apache.lucene.analysis.miscellaneous.FingerprintFilter in project elasticsearch by elastic.

the class FingerprintAnalyzer method createComponents.

@Override
protected TokenStreamComponents createComponents(String s) {
    final Tokenizer tokenizer = new StandardTokenizer();
    TokenStream stream = tokenizer;
    stream = new LowerCaseFilter(stream);
    stream = new ASCIIFoldingFilter(stream, false);
    stream = new StopFilter(stream, stopWords);
    stream = new FingerprintFilter(stream, maxOutputSize, separator);
    return new TokenStreamComponents(tokenizer, stream);
}
Also used : FingerprintFilter(org.apache.lucene.analysis.miscellaneous.FingerprintFilter) TokenStream(org.apache.lucene.analysis.TokenStream) StandardTokenizer(org.apache.lucene.analysis.standard.StandardTokenizer) StopFilter(org.apache.lucene.analysis.StopFilter) ASCIIFoldingFilter(org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter) Tokenizer(org.apache.lucene.analysis.Tokenizer) StandardTokenizer(org.apache.lucene.analysis.standard.StandardTokenizer) LowerCaseFilter(org.apache.lucene.analysis.LowerCaseFilter)

Aggregations

TokenStream (org.apache.lucene.analysis.TokenStream)2 FingerprintFilter (org.apache.lucene.analysis.miscellaneous.FingerprintFilter)2 LowerCaseFilter (org.apache.lucene.analysis.LowerCaseFilter)1 StopFilter (org.apache.lucene.analysis.StopFilter)1 Tokenizer (org.apache.lucene.analysis.Tokenizer)1 ASCIIFoldingFilter (org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter)1 StandardTokenizer (org.apache.lucene.analysis.standard.StandardTokenizer)1