Class DirectCandidateGenerator
org.elasticsearch.search.suggest.phrase.CandidateGenerator
org.elasticsearch.search.suggest.phrase.DirectCandidateGenerator
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Constructor Summary
ConstructorDescriptionDirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates)
DirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates, org.apache.lucene.analysis.Analyzer preFilter, org.apache.lucene.analysis.Analyzer postFilter, org.apache.lucene.index.Terms terms)
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
analyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.BytesRef toAnalyze, field, DirectCandidateGenerator.TokenConsumer consumer, org.apache.lucene.util.CharsRefBuilder spare)
static int
analyze(org.apache.lucene.analysis.TokenStream stream, DirectCandidateGenerator.TokenConsumer consumer)
NOTE: this method closes the TokenStream, even on exception, which is awkward because really the caller who calledAnalyzer.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 TokenStream twice in the same recursion...createCandidate(org.apache.lucene.util.BytesRef term, org.apache.lucene.codecs.TermStats termStats, double channelScore, boolean userInput)
getField()
org.apache.lucene.codecs.TermStats
internalTermStats(org.apache.lucene.util.BytesRef term)
boolean
isKnownWord(org.apache.lucene.util.BytesRef term)
protected void
postFilter(DirectCandidateGenerator.Candidate candidate, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare, <DirectCandidateGenerator.Candidate> candidates)
protected org.apache.lucene.util.BytesRef
preFilter(org.apache.lucene.util.BytesRef term, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare)
org.apache.lucene.codecs.TermStats
termStats(org.apache.lucene.util.BytesRef term)
Methods inherited from class org.elasticsearch.search.suggest.phrase.CandidateGenerator
createCandidate, createCandidate, drawCandidates
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
DirectCandidateGenerator
public DirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates) throws- Throws:
-
DirectCandidateGenerator
public DirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates, org.apache.lucene.analysis.Analyzer preFilter, org.apache.lucene.analysis.Analyzer postFilter, org.apache.lucene.index.Terms terms) throws- Throws:
-
-
Method Details
-
isKnownWord
public boolean isKnownWord(org.apache.lucene.util.BytesRef term) throws- Specified by:
isKnownWord
in classCandidateGenerator
- Throws:
-
termStats
public org.apache.lucene.codecs.TermStats termStats(org.apache.lucene.util.BytesRef term) throws- Specified by:
termStats
in classCandidateGenerator
- Throws:
-
internalTermStats
public org.apache.lucene.codecs.TermStats internalTermStats(org.apache.lucene.util.BytesRef term) throws- Throws:
-
getField
public getField() -
drawCandidates
public DirectCandidateGenerator.CandidateSet drawCandidates(DirectCandidateGenerator.CandidateSet set) throws- Specified by:
drawCandidates
in classCandidateGenerator
- Throws:
-
preFilter
protected org.apache.lucene.util.BytesRef preFilter(org.apache.lucene.util.BytesRef term, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare) throws- Throws:
-
postFilter
protected void postFilter(DirectCandidateGenerator.Candidate candidate, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare, <DirectCandidateGenerator.Candidate> candidates) throws- Throws:
-
createCandidate
public DirectCandidateGenerator.Candidate createCandidate(org.apache.lucene.util.BytesRef term, org.apache.lucene.codecs.TermStats termStats, double channelScore, boolean userInput) throws- Specified by:
createCandidate
in classCandidateGenerator
- Throws:
-
analyze
public static int analyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.BytesRef toAnalyze, field, DirectCandidateGenerator.TokenConsumer consumer, org.apache.lucene.util.CharsRefBuilder spare) throws- Throws:
-
analyze
public static int analyze(org.apache.lucene.analysis.TokenStream stream, DirectCandidateGenerator.TokenConsumer consumer) throwsNOTE: this method closes the TokenStream, even on exception, which is awkward because really the caller who calledAnalyzer.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 TokenStream twice in the same recursion...- Throws:
-