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 DocIdSetIteratorprivate final ImpactsDISIprivate 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 booleanadvancePosition(ExactPhraseMatcher.PostingsAndPosition posting, int target) Advance the given pos enum to the first position on or aftertarget.(package private) DocIdSetIteratorApproximation that only matches documents that have all terms.intThe end offset of the current matchintThe end position of the current match(package private) ImpactsDISIApproximation 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.booleanFind the next match on the current document, returningfalseif there are none.voidreset()Called afterPhraseMatcher.approximation()has been advanced(package private) floatThe slop-adjusted weight of the current matchintThe start offset of the current matchintThe 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: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 IOException Advance the given pos enum to the first position on or aftertarget. Returnfalseif the enum was exhausted before reachingtargetandtrueotherwise.- Throws:
IOException
-
reset
Description copied from class:PhraseMatcherCalled afterPhraseMatcher.approximation()has been advanced- Specified by:
resetin classPhraseMatcher- Throws:
IOException
-
nextMatch
Description copied from class:PhraseMatcherFind the next match on the current document, returningfalseif there are none.- Specified by:
nextMatchin classPhraseMatcher- Throws:
IOException
-
sloppyWeight
float sloppyWeight()Description copied from class:PhraseMatcherThe slop-adjusted weight of the current matchThe 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
Description copied from class:PhraseMatcherThe start offset of the current match- Specified by:
startOffsetin classPhraseMatcher- Throws:
IOException
-
endOffset
Description copied from class:PhraseMatcherThe end offset of the current match- Specified by:
endOffsetin classPhraseMatcher- Throws:
IOException
-
mergeImpacts
Merge impacts for multiple terms of an exact phrase.
-