Package org.apache.lucene.search
Class ExactPhraseMatcher
java.lang.Object
org.apache.lucene.search.PhraseMatcher
org.apache.lucene.search.ExactPhraseMatcher
Expert: Find exact phrases
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DocIdSetIterator
private final ImpactsDISI
private final ExactPhraseMatcher.PostingsAndPosition[]
-
Constructor Summary
ConstructorsConstructorDescriptionExactPhraseMatcher
(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, Similarity.SimScorer scorer, float matchCost) Expert: Creates ExactPhraseMatcher instance -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
advancePosition
(ExactPhraseMatcher.PostingsAndPosition posting, int target) Advance the given pos enum to the first doc on or aftertarget
.(package private) DocIdSetIterator
Approximation that only matches documents that have all terms.int
The end offset of the current matchint
The end position of the current match(package private) ImpactsDISI
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
Find the next match on the current document, returningfalse
if there are none.void
reset()
Called afterPhraseMatcher.approximation()
has been advanced(package private) float
The slop-adjusted weight of the current matchint
The start offset of the current matchint
The start position of the current matchMethods inherited from class org.apache.lucene.search.PhraseMatcher
getMatchCost
-
Field Details
-
postings
-
approximation
-
impactsApproximation
-
-
Constructor Details
-
ExactPhraseMatcher
public ExactPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, ScoreMode scoreMode, Similarity.SimScorer scorer, float matchCost) Expert: Creates ExactPhraseMatcher instance
-
-
Method Details
-
approximation
DocIdSetIterator approximation()Description copied from class:PhraseMatcher
Approximation that only matches documents that have all terms.- Specified by:
approximation
in classPhraseMatcher
-
impactsApproximation
ImpactsDISI impactsApproximation()Description copied from class:PhraseMatcher
Approximation that is aware of impacts.- Specified by:
impactsApproximation
in classPhraseMatcher
-
maxFreq
float maxFreq()Description copied from class:PhraseMatcher
An upper bound on the number of possible matches on this document- Specified by:
maxFreq
in classPhraseMatcher
-
advancePosition
private static boolean advancePosition(ExactPhraseMatcher.PostingsAndPosition posting, int target) throws IOException Advance the given pos enum to the first doc on or aftertarget
. Returnfalse
if the enum was exhausted before reachingtarget
andtrue
otherwise.- Throws:
IOException
-
reset
Description copied from class:PhraseMatcher
Called afterPhraseMatcher.approximation()
has been advanced- Specified by:
reset
in classPhraseMatcher
- Throws:
IOException
-
nextMatch
Description copied from class:PhraseMatcher
Find the next match on the current document, returningfalse
if there are none.- Specified by:
nextMatch
in classPhraseMatcher
- Throws:
IOException
-
sloppyWeight
float sloppyWeight()Description copied from class:PhraseMatcher
The slop-adjusted weight of the current matchThe sum of the slop-adjusted weights is used as the freq for scoring
- Specified by:
sloppyWeight
in classPhraseMatcher
-
startPosition
public int startPosition()Description copied from class:PhraseMatcher
The start position of the current match- Specified by:
startPosition
in classPhraseMatcher
-
endPosition
public int endPosition()Description copied from class:PhraseMatcher
The end position of the current match- Specified by:
endPosition
in classPhraseMatcher
-
startOffset
Description copied from class:PhraseMatcher
The start offset of the current match- Specified by:
startOffset
in classPhraseMatcher
- Throws:
IOException
-
endOffset
Description copied from class:PhraseMatcher
The end offset of the current match- Specified by:
endOffset
in classPhraseMatcher
- Throws:
IOException
-
mergeImpacts
Merge impacts for multiple terms of an exact phrase.
-