Module org.elasticsearch.server
Class DirectCandidateGenerator
java.lang.Object
org.elasticsearch.search.suggest.phrase.CandidateGenerator
org.elasticsearch.search.suggest.phrase.DirectCandidateGenerator
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class
- 
Constructor SummaryConstructorsConstructorDescriptionDirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, String 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, String 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 SummaryModifier and TypeMethodDescriptionstatic intanalyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.BytesRef toAnalyze, String field, DirectCandidateGenerator.TokenConsumer consumer, org.apache.lucene.util.CharsRefBuilder spare) static intanalyze(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.TermStatsinternalTermStats(org.apache.lucene.util.BytesRef term) booleanisKnownWord(org.apache.lucene.util.BytesRef term) protected voidpostFilter(DirectCandidateGenerator.Candidate candidate, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare, List<DirectCandidateGenerator.Candidate> candidates) protected org.apache.lucene.util.BytesRefpreFilter(org.apache.lucene.util.BytesRef term, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare) org.apache.lucene.codecs.TermStatstermStats(org.apache.lucene.util.BytesRef term) Methods inherited from class org.elasticsearch.search.suggest.phrase.CandidateGeneratorcreateCandidate, createCandidate, drawCandidates
- 
Constructor Details- 
DirectCandidateGeneratorpublic DirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, String field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates) throws IOException - Throws:
- IOException
 
- 
DirectCandidateGeneratorpublic DirectCandidateGenerator(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, String 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 IOException - Throws:
- IOException
 
 
- 
- 
Method Details- 
isKnownWord- Specified by:
- isKnownWordin class- CandidateGenerator
- Throws:
- IOException
 
- 
termStatspublic org.apache.lucene.codecs.TermStats termStats(org.apache.lucene.util.BytesRef term) throws IOException - Specified by:
- termStatsin class- CandidateGenerator
- Throws:
- IOException
 
- 
internalTermStatspublic org.apache.lucene.codecs.TermStats internalTermStats(org.apache.lucene.util.BytesRef term) throws IOException - Throws:
- IOException
 
- 
getField
- 
drawCandidatespublic DirectCandidateGenerator.CandidateSet drawCandidates(DirectCandidateGenerator.CandidateSet set) throws IOException - Specified by:
- drawCandidatesin class- CandidateGenerator
- Throws:
- IOException
 
- 
preFilterprotected 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 IOException - Throws:
- IOException
 
- 
postFilterprotected void postFilter(DirectCandidateGenerator.Candidate candidate, org.apache.lucene.util.CharsRefBuilder spare, org.apache.lucene.util.BytesRefBuilder byteSpare, List<DirectCandidateGenerator.Candidate> candidates) throws IOException - Throws:
- IOException
 
- 
createCandidatepublic DirectCandidateGenerator.Candidate createCandidate(org.apache.lucene.util.BytesRef term, org.apache.lucene.codecs.TermStats termStats, double channelScore, boolean userInput) throws IOException - Specified by:
- createCandidatein class- CandidateGenerator
- Throws:
- IOException
 
- 
analyzepublic static int analyze(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.util.BytesRef toAnalyze, String field, DirectCandidateGenerator.TokenConsumer consumer, org.apache.lucene.util.CharsRefBuilder spare) throws IOException - Throws:
- IOException
 
- 
analyzepublic static int analyze(org.apache.lucene.analysis.TokenStream stream, DirectCandidateGenerator.TokenConsumer consumer) throws IOException 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...- Throws:
- IOException
 
 
-