Package org.apache.lucene.search
Class PhraseMatcher
- java.lang.Object
-
- org.apache.lucene.search.PhraseMatcher
-
- Direct Known Subclasses:
ExactPhraseMatcher,SloppyPhraseMatcher
abstract class PhraseMatcher extends java.lang.ObjectBase class for exact and sloppy phrase matching To find matches on a document, first advanceapproximation()to the relevant document, then callreset(). Clients can then callnextMatch()to iterate over the matches
-
-
Field Summary
Fields Modifier and Type Field Description private floatmatchCost
-
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 DocIdSetIteratorapproximation()Approximation that only matches documents that have all terms.(package private) abstract intendOffset()The end offset of the current match(package private) abstract intendPosition()The end position of the current matchfloatgetMatchCost()An estimate of the average cost of finding all matches on a document(package private) abstract ImpactsDISIimpactsApproximation()Approximation that is aware of impacts.(package private) abstract floatmaxFreq()An upper bound on the number of possible matches on this documentabstract booleannextMatch()Find the next match on the current document, returningfalseif there are none.abstract voidreset()Called afterapproximation()has been advanced(package private) abstract floatsloppyWeight()The slop-adjusted weight of the current match The sum of the slop-adjusted weights is used as the freq for scoring(package private) abstract intstartOffset()The start offset of the current match(package private) abstract intstartPosition()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.IOExceptionAn upper bound on the number of possible matches on this document- Throws:
java.io.IOException
-
reset
public abstract void reset() throws java.io.IOExceptionCalled afterapproximation()has been advanced- Throws:
java.io.IOException
-
nextMatch
public abstract boolean nextMatch() throws java.io.IOExceptionFind the next match on the current document, returningfalseif there are none.- Throws:
java.io.IOException
-
sloppyWeight
abstract float sloppyWeight()
The slop-adjusted weight of the current match The 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.IOExceptionThe start offset of the current match- Throws:
java.io.IOException
-
endOffset
abstract int endOffset() throws java.io.IOExceptionThe 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()
-
-