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
Fields inherited from class org.apache.lucene.queries.spans.SpanPositionCheckQuery
match
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected FilterSpans.AcceptStatus
acceptPosition
(Spans spans) Implementing classes are required to return whether the current position is a match for the passed in "match"SpanQuery
.boolean
Returns true iffother
is equal to this.int
getEnd()
int
getStart()
int
hashCode()
Methods inherited from class org.apache.lucene.queries.spans.SpanPositionCheckQuery
createWeight, getField, getMatch, rewrite, visit
Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStates
Methods 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:SpanPositionCheckQuery
Implementing 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:
acceptPosition
in classSpanPositionCheckQuery
- Parameters:
spans
- TheSpans
instance, 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:SpanPositionCheckQuery
Returns true iffother
is equal to this.- Overrides:
equals
in classSpanPositionCheckQuery
-
hashCode
public int hashCode()- Overrides:
hashCode
in classSpanPositionCheckQuery
-