Class WordScorer
- java.lang.Object
-
- org.elasticsearch.search.suggest.phrase.WordScorer
-
- Direct Known Subclasses:
LinearInterpolatingScorer
public abstract class WordScorer extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWordScorer.WordScorerFactory
-
Field Summary
Fields Modifier and Type Field Description protected Stringfieldprotected longnumTermsprotected IndexReaderreaderprotected doublerealWordLikelihoodprotected BytesRefseparatorprotected BytesRefBuilderspareprotected Termstermsprotected longvocabluarySize
-
Constructor Summary
Constructors Constructor Description WordScorer(IndexReader reader, String field, double realWordLikelihood, BytesRef separator)WordScorer(IndexReader reader, Terms terms, String field, double realWordLikelihood, BytesRef separator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublechannelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original)longfrequency(BytesRef term)static BytesRefjoin(BytesRef separator, BytesRefBuilder result, BytesRef... toJoin)doublescore(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize)protected doublescoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1)protected doublescoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2)protected doublescoreUnigram(DirectCandidateGenerator.Candidate word)
-
-
-
Field Detail
-
reader
protected final IndexReader reader
-
field
protected final String field
-
terms
protected final Terms terms
-
vocabluarySize
protected final long vocabluarySize
-
realWordLikelihood
protected final double realWordLikelihood
-
spare
protected final BytesRefBuilder spare
-
separator
protected final BytesRef separator
-
numTerms
protected final long numTerms
-
-
Constructor Detail
-
WordScorer
public WordScorer(IndexReader reader, String field, double realWordLikelihood, BytesRef separator) throws IOException
- Throws:
IOException
-
WordScorer
public WordScorer(IndexReader reader, Terms terms, String field, double realWordLikelihood, BytesRef separator) throws IOException
- Throws:
IOException
-
-
Method Detail
-
frequency
public long frequency(BytesRef term) throws IOException
- Throws:
IOException
-
channelScore
protected double channelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original) throws IOException
- Throws:
IOException
-
score
public double score(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize) throws IOException
- Throws:
IOException
-
scoreUnigram
protected double scoreUnigram(DirectCandidateGenerator.Candidate word) throws IOException
- Throws:
IOException
-
scoreBigram
protected double scoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1) throws IOException
- Throws:
IOException
-
scoreTrigram
protected double scoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2) throws IOException
- Throws:
IOException
-
join
public static BytesRef join(BytesRef separator, BytesRefBuilder result, BytesRef... toJoin)
-
-