Class WordScorer
java.lang.Object
org.elasticsearch.search.suggest.phrase.WordScorer
- Direct Known Subclasses:
LinearInterpolatingScorer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected longprotected org.apache.lucene.index.IndexReaderprotected doubleprotected org.apache.lucene.util.BytesRefprotected org.apache.lucene.util.BytesRefBuilderprotected org.apache.lucene.index.Termsprotected long -
Constructor Summary
ConstructorsConstructorDescriptionWordScorer(org.apache.lucene.index.IndexReader reader, String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator)WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) -
Method Summary
Modifier and TypeMethodDescriptionprotected doublechannelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original)longfrequency(org.apache.lucene.util.BytesRef term)static org.apache.lucene.util.BytesRefjoin(org.apache.lucene.util.BytesRef separator, org.apache.lucene.util.BytesRefBuilder result, org.apache.lucene.util.BytesRef... toJoin)doublescore(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize)protected doubleprotected doublescoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2)protected double
-
Field Details
-
reader
protected final org.apache.lucene.index.IndexReader reader -
field
-
terms
protected final org.apache.lucene.index.Terms terms -
vocabluarySize
protected final long vocabluarySize -
realWordLikelihood
protected final double realWordLikelihood -
spare
protected final org.apache.lucene.util.BytesRefBuilder spare -
separator
protected final org.apache.lucene.util.BytesRef separator -
numTerms
protected final long numTerms
-
-
Constructor Details
-
WordScorer
public WordScorer(org.apache.lucene.index.IndexReader reader, String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws IOException- Throws:
IOException
-
WordScorer
public WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws IOException- Throws:
IOException
-
-
Method Details
-
frequency
- 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
- 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 org.apache.lucene.util.BytesRef join(org.apache.lucene.util.BytesRef separator, org.apache.lucene.util.BytesRefBuilder result, org.apache.lucene.util.BytesRef... toJoin)
-