Package org.apache.lucene.queries.spans
Class SpanPositionRangeQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.spans.SpanQuery
org.apache.lucene.queries.spans.SpanPositionCheckQuery
org.apache.lucene.queries.spans.SpanPositionRangeQuery
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
SpanFirstQuery
Checks to see if the
SpanPositionCheckQuery.getMatch() lies between a start and end position
See SpanFirstQuery for a derivation that is optimized for the case where start
position is 0.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.queries.spans.SpanPositionCheckQuery
SpanPositionCheckQuery.SpanPositionCheckWeight -
Field Summary
FieldsFields inherited from class org.apache.lucene.queries.spans.SpanPositionCheckQuery
match -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FilterSpans.AcceptStatusacceptPosition(Spans spans) Implementing classes are required to return whether the current position is a match for the passed in "match"SpanQuery.booleanReturns true iffotheris equal to this.intgetEnd()intgetStart()inthashCode()Methods inherited from class org.apache.lucene.queries.spans.SpanPositionCheckQuery
createWeight, getField, getMatch, rewrite, visitMethods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStatesMethods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
Field Details
-
start
protected int start -
end
protected int end
-
-
Constructor Details
-
SpanPositionRangeQuery
-
-
Method Details
-
acceptPosition
Description copied from class:SpanPositionCheckQueryImplementing classes are required to return whether the current position is a match for the passed in "match"SpanQuery.This is only called if the underlying last
Spans.nextStartPosition()for the match indicated a valid start position.- Specified by:
acceptPositionin classSpanPositionCheckQuery- Parameters:
spans- TheSpansinstance, positioned at the spot to check- Returns:
- whether the match is accepted, rejected, or rejected and should move to the next doc.
- Throws:
IOException- See Also:
-
getStart
public int getStart()- Returns:
- The minimum position permitted in a match
-
getEnd
public int getEnd()- Returns:
- the maximum end position permitted in a match.
-
toString
-
equals
Description copied from class:SpanPositionCheckQueryReturns true iffotheris equal to this.- Overrides:
equalsin classSpanPositionCheckQuery
-
hashCode
public int hashCode()- Overrides:
hashCodein classSpanPositionCheckQuery
-