public final class SuggestUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SuggestUtils.Fields |
static class |
SuggestUtils.TokenConsumer |
Modifier and Type | Field and Description |
---|---|
static Comparator<org.apache.lucene.search.spell.SuggestWord> |
LUCENE_FREQUENCY |
static Comparator<org.apache.lucene.search.spell.SuggestWord> |
SCORE_COMPARATOR |
Modifier and Type | Method and Description |
---|---|
static int |
analyze(org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.util.BytesRef toAnalyze,
String field,
SuggestUtils.TokenConsumer consumer,
org.apache.lucene.util.CharsRefBuilder spare) |
static int |
analyze(org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.util.CharsRef toAnalyze,
String field,
SuggestUtils.TokenConsumer consumer) |
static int |
analyze(org.apache.lucene.analysis.TokenStream stream,
SuggestUtils.TokenConsumer consumer)
NOTE: this method closes the TokenStream, even on exception, which is awkward
because really the caller who called
Analyzer.tokenStream(java.lang.String, java.io.Reader) should close it,
but when trying that there are recursion issues when we try to use the same
TokenStrem twice in the same recursion... |
static org.apache.lucene.search.spell.DirectSpellChecker |
getDirectSpellChecker(DirectSpellcheckerSettings suggestion) |
static ShingleTokenFilterFactory.Factory |
getShingleFilterFactory(org.apache.lucene.analysis.Analyzer analyzer) |
static org.apache.lucene.util.BytesRef |
join(org.apache.lucene.util.BytesRef separator,
org.apache.lucene.util.BytesRefBuilder result,
org.apache.lucene.util.BytesRef... toJoin) |
static boolean |
parseDirectSpellcheckerSettings(XContentParser parser,
String fieldName,
DirectSpellcheckerSettings suggestion,
ParseFieldMatcher parseFieldMatcher) |
static boolean |
parseSuggestContext(XContentParser parser,
MapperService mapperService,
String fieldName,
SuggestionSearchContext.SuggestionContext suggestion,
ParseFieldMatcher parseFieldMatcher) |
static org.apache.lucene.search.spell.StringDistance |
resolveDistance(String distanceVal) |
static Suggest.Suggestion.Sort |
resolveSort(String sortVal) |
static org.apache.lucene.search.spell.SuggestMode |
resolveSuggestMode(String suggestMode) |
static void |
verifySuggestion(MapperService mapperService,
org.apache.lucene.util.BytesRef globalText,
SuggestionSearchContext.SuggestionContext suggestion) |
public static final Comparator<org.apache.lucene.search.spell.SuggestWord> LUCENE_FREQUENCY
public static final Comparator<org.apache.lucene.search.spell.SuggestWord> SCORE_COMPARATOR
public static org.apache.lucene.search.spell.DirectSpellChecker getDirectSpellChecker(DirectSpellcheckerSettings suggestion)
public static org.apache.lucene.util.BytesRef join(org.apache.lucene.util.BytesRef separator, org.apache.lucene.util.BytesRefBuilder result, org.apache.lucene.util.BytesRef... toJoin)
public static int analyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.BytesRef toAnalyze, String field, SuggestUtils.TokenConsumer consumer, org.apache.lucene.util.CharsRefBuilder spare) throws IOException
IOException
public static int analyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.CharsRef toAnalyze, String field, SuggestUtils.TokenConsumer consumer) throws IOException
IOException
public static int analyze(org.apache.lucene.analysis.TokenStream stream, SuggestUtils.TokenConsumer consumer) throws IOException
Analyzer.tokenStream(java.lang.String, java.io.Reader)
should close it,
but when trying that there are recursion issues when we try to use the same
TokenStrem twice in the same recursion...IOException
public static org.apache.lucene.search.spell.SuggestMode resolveSuggestMode(String suggestMode)
public static Suggest.Suggestion.Sort resolveSort(String sortVal)
public static org.apache.lucene.search.spell.StringDistance resolveDistance(String distanceVal)
public static boolean parseDirectSpellcheckerSettings(XContentParser parser, String fieldName, DirectSpellcheckerSettings suggestion, ParseFieldMatcher parseFieldMatcher) throws IOException
IOException
public static boolean parseSuggestContext(XContentParser parser, MapperService mapperService, String fieldName, SuggestionSearchContext.SuggestionContext suggestion, ParseFieldMatcher parseFieldMatcher) throws IOException
IOException
public static void verifySuggestion(MapperService mapperService, org.apache.lucene.util.BytesRef globalText, SuggestionSearchContext.SuggestionContext suggestion)
public static ShingleTokenFilterFactory.Factory getShingleFilterFactory(org.apache.lucene.analysis.Analyzer analyzer)
Copyright © 2009–2016. All rights reserved.