final class ExactPhraseMatcher extends PhraseMatcher
Modifier and Type | Class and Description |
---|---|
private static class |
ExactPhraseMatcher.PostingsAndPosition |
Modifier and Type | Field and Description |
---|---|
private DocIdSetIterator |
approximation |
private ImpactsDISI |
impactsApproximation |
private ExactPhraseMatcher.PostingsAndPosition[] |
postings |
Constructor and Description |
---|
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings,
ScoreMode scoreMode,
Similarity.SimScorer scorer,
float matchCost) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
advancePosition(ExactPhraseMatcher.PostingsAndPosition posting,
int target)
Advance the given pos enum to the first doc on or after
target . |
(package private) DocIdSetIterator |
approximation()
Approximation that only matches documents that have all terms.
|
int |
endOffset()
The end offset of the current match
|
int |
endPosition()
The end position of the current match
|
(package private) ImpactsDISI |
impactsApproximation()
Approximation that is aware of impacts.
|
(package private) float |
maxFreq()
An upper bound on the number of possible matches on this document
|
(package private) static ImpactsSource |
mergeImpacts(ImpactsEnum[] impactsEnums)
Merge impacts for multiple terms of an exact phrase.
|
boolean |
nextMatch()
Find the next match on the current document, returning
false if there
are none. |
void |
reset()
Called after
PhraseMatcher.approximation() has been advanced |
(package private) float |
sloppyWeight()
The slop-adjusted weight of the current match
The sum of the slop-adjusted weights is used as the freq for scoring
|
int |
startOffset()
The start offset of the current match
|
int |
startPosition()
The start position of the current match
|
getMatchCost
private final ExactPhraseMatcher.PostingsAndPosition[] postings
private final DocIdSetIterator approximation
private final ImpactsDISI impactsApproximation
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, Similarity.SimScorer scorer, float matchCost)
DocIdSetIterator approximation()
PhraseMatcher
approximation
in class PhraseMatcher
ImpactsDISI impactsApproximation()
PhraseMatcher
impactsApproximation
in class PhraseMatcher
float maxFreq()
PhraseMatcher
maxFreq
in class PhraseMatcher
private static boolean advancePosition(ExactPhraseMatcher.PostingsAndPosition posting, int target) throws java.io.IOException
target
.
Return false
if the enum was exhausted before reaching
target
and true
otherwise.java.io.IOException
public void reset() throws java.io.IOException
PhraseMatcher
PhraseMatcher.approximation()
has been advancedreset
in class PhraseMatcher
java.io.IOException
public boolean nextMatch() throws java.io.IOException
PhraseMatcher
false
if there
are none.nextMatch
in class PhraseMatcher
java.io.IOException
float sloppyWeight()
PhraseMatcher
sloppyWeight
in class PhraseMatcher
public int startPosition()
PhraseMatcher
startPosition
in class PhraseMatcher
public int endPosition()
PhraseMatcher
endPosition
in class PhraseMatcher
public int startOffset() throws java.io.IOException
PhraseMatcher
startOffset
in class PhraseMatcher
java.io.IOException
public int endOffset() throws java.io.IOException
PhraseMatcher
endOffset
in class PhraseMatcher
java.io.IOException
static ImpactsSource mergeImpacts(ImpactsEnum[] impactsEnums)