Package org.apache.lucene.search
Class ExactPhraseMatcher
- java.lang.Object
-
- org.apache.lucene.search.PhraseMatcher
-
- org.apache.lucene.search.ExactPhraseMatcher
-
final class ExactPhraseMatcher extends PhraseMatcher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classExactPhraseMatcher.PostingsAndPosition
-
Field Summary
Fields Modifier and Type Field Description private DocIdSetIteratorapproximationprivate ImpactsDISIimpactsApproximationprivate ExactPhraseMatcher.PostingsAndPosition[]postings
-
Constructor Summary
Constructors Constructor Description ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, Similarity.SimScorer scorer, float matchCost)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanadvancePosition(ExactPhraseMatcher.PostingsAndPosition posting, int target)Advance the given pos enum to the first doc on or aftertarget.(package private) DocIdSetIteratorapproximation()Approximation that only matches documents that have all terms.intendOffset()The end offset of the current matchintendPosition()The end position of the current match(package private) ImpactsDISIimpactsApproximation()Approximation that is aware of impacts.(package private) floatmaxFreq()An upper bound on the number of possible matches on this document(package private) static ImpactsSourcemergeImpacts(ImpactsEnum[] impactsEnums)Merge impacts for multiple terms of an exact phrase.booleannextMatch()Find the next match on the current document, returningfalseif there are none.voidreset()Called afterPhraseMatcher.approximation()has been advanced(package private) floatsloppyWeight()The slop-adjusted weight of the current match The sum of the slop-adjusted weights is used as the freq for scoringintstartOffset()The start offset of the current matchintstartPosition()The start position of the current match-
Methods inherited from class org.apache.lucene.search.PhraseMatcher
getMatchCost
-
-
-
-
Field Detail
-
postings
private final ExactPhraseMatcher.PostingsAndPosition[] postings
-
approximation
private final DocIdSetIterator approximation
-
impactsApproximation
private final ImpactsDISI impactsApproximation
-
-
Constructor Detail
-
ExactPhraseMatcher
ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, Similarity.SimScorer scorer, float matchCost)
-
-
Method Detail
-
approximation
DocIdSetIterator approximation()
Description copied from class:PhraseMatcherApproximation that only matches documents that have all terms.- Specified by:
approximationin classPhraseMatcher
-
impactsApproximation
ImpactsDISI impactsApproximation()
Description copied from class:PhraseMatcherApproximation that is aware of impacts.- Specified by:
impactsApproximationin classPhraseMatcher
-
maxFreq
float maxFreq()
Description copied from class:PhraseMatcherAn upper bound on the number of possible matches on this document- Specified by:
maxFreqin classPhraseMatcher
-
advancePosition
private static boolean advancePosition(ExactPhraseMatcher.PostingsAndPosition posting, int target) throws java.io.IOException
Advance the given pos enum to the first doc on or aftertarget. Returnfalseif the enum was exhausted before reachingtargetandtrueotherwise.- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOExceptionDescription copied from class:PhraseMatcherCalled afterPhraseMatcher.approximation()has been advanced- Specified by:
resetin classPhraseMatcher- Throws:
java.io.IOException
-
nextMatch
public boolean nextMatch() throws java.io.IOExceptionDescription copied from class:PhraseMatcherFind the next match on the current document, returningfalseif there are none.- Specified by:
nextMatchin classPhraseMatcher- Throws:
java.io.IOException
-
sloppyWeight
float sloppyWeight()
Description copied from class:PhraseMatcherThe slop-adjusted weight of the current match The sum of the slop-adjusted weights is used as the freq for scoring- Specified by:
sloppyWeightin classPhraseMatcher
-
startPosition
public int startPosition()
Description copied from class:PhraseMatcherThe start position of the current match- Specified by:
startPositionin classPhraseMatcher
-
endPosition
public int endPosition()
Description copied from class:PhraseMatcherThe end position of the current match- Specified by:
endPositionin classPhraseMatcher
-
startOffset
public int startOffset() throws java.io.IOExceptionDescription copied from class:PhraseMatcherThe start offset of the current match- Specified by:
startOffsetin classPhraseMatcher- Throws:
java.io.IOException
-
endOffset
public int endOffset() throws java.io.IOExceptionDescription copied from class:PhraseMatcherThe end offset of the current match- Specified by:
endOffsetin classPhraseMatcher- Throws:
java.io.IOException
-
mergeImpacts
static ImpactsSource mergeImpacts(ImpactsEnum[] impactsEnums)
Merge impacts for multiple terms of an exact phrase.
-
-