- java.lang.Object
-
- org.apache.lucene.search.PhraseMatcher
-
- Direct Known Subclasses:
ExactPhraseMatcher
,SloppyPhraseMatcher
public abstract class PhraseMatcher extends java.lang.Object
Base class for exact and sloppy phrase matchingTo find matches on a document, first advance
approximation()
to the relevant document, then callreset()
. Clients can then callnextMatch()
to iterate over the matches
-
-
Field Summary
Fields Modifier and Type Field Description private float
matchCost
-
Constructor Summary
Constructors Constructor Description PhraseMatcher(float matchCost)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract DocIdSetIterator
approximation()
Approximation that only matches documents that have all terms.(package private) abstract int
endOffset()
The end offset of the current match(package private) abstract int
endPosition()
The end position of the current matchfloat
getMatchCost()
An estimate of the average cost of finding all matches on a document(package private) abstract ImpactsDISI
impactsApproximation()
Approximation that is aware of impacts.(package private) abstract float
maxFreq()
An upper bound on the number of possible matches on this documentabstract boolean
nextMatch()
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
sloppyWeight()
The slop-adjusted weight of the current match(package private) abstract int
startOffset()
The start offset of the current match(package private) abstract int
startPosition()
The start position of the current match
-
-
-
Method Detail
-
approximation
abstract DocIdSetIterator approximation()
Approximation that only matches documents that have all terms.
-
impactsApproximation
abstract ImpactsDISI impactsApproximation()
Approximation that is aware of impacts.
-
maxFreq
abstract float maxFreq() throws java.io.IOException
An upper bound on the number of possible matches on this document- Throws:
java.io.IOException
-
reset
public abstract void reset() throws java.io.IOException
Called afterapproximation()
has been advanced- Throws:
java.io.IOException
-
nextMatch
public abstract boolean nextMatch() throws java.io.IOException
Find the next match on the current document, returningfalse
if there are none.- Throws:
java.io.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
abstract int startOffset() throws java.io.IOException
The start offset of the current match- Throws:
java.io.IOException
-
endOffset
abstract int endOffset() throws java.io.IOException
The end offset of the current match- Throws:
java.io.IOException
-
getMatchCost
public float getMatchCost()
An estimate of the average cost of finding all matches on a document- See Also:
TwoPhaseIterator.matchCost()
-
-