final class ExactPhraseMatcher extends PhraseMatcher
Modifier and Type | Class and Description |
---|---|
private static class |
ExactPhraseMatcher.PostingsAndPosition |
Modifier and Type | Field and Description |
---|---|
private ExactPhraseMatcher.PostingsAndPosition[] |
postings |
approximation
Constructor and Description |
---|
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings,
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 . |
private static DocIdSetIterator |
approximation(PhraseQuery.PostingsAndFreq[] postings) |
int |
endOffset()
The end offset of the current match
|
int |
endPosition()
The end position of the current match
|
(package private) float |
maxFreq()
An upper bound on the number of possible matches on this document
|
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
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, float matchCost)
private static DocIdSetIterator approximation(PhraseQuery.PostingsAndFreq[] postings)
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