java.lang.Object
org.apache.lucene.search.PhraseMatcher
- Direct Known Subclasses:
ExactPhraseMatcher
,SloppyPhraseMatcher
Base class for exact and sloppy phrase matching
To find matches on a document, first advance approximation()
to the relevant document,
then call reset()
. Clients can then call nextMatch()
to iterate over the
matches
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract DocIdSetIterator
Approximation that only matches documents that have all terms.(package private) abstract int
The end offset of the current match(package private) abstract int
The end position of the current matchfloat
An estimate of the average cost of finding all matches on a document(package private) abstract ImpactsDISI
Approximation that is aware of impacts.(package private) abstract float
maxFreq()
An upper bound on the number of possible matches on this documentabstract boolean
Find the next match on the current document, returningfalse
if there are none.abstract void
reset()
Called afterapproximation()
has been advanced(package private) abstract float
The slop-adjusted weight of the current match(package private) abstract int
The start offset of the current match(package private) abstract int
The start position of the current match
-
Field Details
-
matchCost
private final float matchCost
-
-
Constructor Details
-
PhraseMatcher
PhraseMatcher(float matchCost)
-
-
Method Details
-
approximation
Approximation that only matches documents that have all terms. -
impactsApproximation
Approximation that is aware of impacts. -
maxFreq
An upper bound on the number of possible matches on this document- Throws:
IOException
-
reset
Called afterapproximation()
has been advanced- Throws:
IOException
-
nextMatch
Find the next match on the current document, returningfalse
if there are none.- Throws:
IOException
-
sloppyWeight
abstract float sloppyWeight()The slop-adjusted weight of the current matchThe sum of the slop-adjusted weights is used as the freq for scoring
-
startPosition
abstract int startPosition()The start position of the current match -
endPosition
abstract int endPosition()The end position of the current match -
startOffset
The start offset of the current match- Throws:
IOException
-
endOffset
The end offset of the current match- Throws:
IOException
-
getMatchCost
public float getMatchCost()An estimate of the average cost of finding all matches on a document- See Also:
-