public class PrefixAnalyzer extends org.apache .lucene .analysis .Analyzer
Analyzer wraps another analyzer and adds a set of prefixes to the underlying TokenStream. While these prefixes are iterated the position attribute will not be incremented. Also each prefix will be separated from the other tokens by a separator character. NOTE: The sequence of prefixes needs to be not empty
| Modifier and Type | Class and Description |
|---|---|
static class |
PrefixAnalyzer
The
PrefixAnalyzer.PrefixTokenFilter wraps a
TokenStream and adds a set prefixes ahead.
|
org.apache.lucene.analysis.Analyzer.GlobalReuseStrategy, org.apache.lucene.analysis.Analyzer.PerFieldReuseStrategy, org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents | Constructor and Description |
|---|
PrefixAnalyzer(org
Create a new
PrefixAnalyzer.
|
PrefixAnalyzer(org
Create a new
PrefixAnalyzer.
|
| Modifier and Type | Method and Description |
|---|---|
protected org |
createComponents(String
|
public PrefixAnalyzer(org.apache .lucene .analysis .Analyzer analyzer, char separator, CharSequence prefix)
PrefixAnalyzer. The separator will be set to the DEFAULT_SEPARATOR.
analyzer -
Analyzer to wrap
prefix - Single prefix
public PrefixAnalyzer(org.apache .lucene .analysis .Analyzer analyzer, char separator, Iterable <? extends CharSequence > prefix)
PrefixAnalyzer. The separator will be set to the DEFAULT_SEPARATOR.
analyzer -
Analyzer to wrap
prefix -
Iterable of
CharSequence which keeps all prefixes