Package org.apache.lucene.spatial.util
Class ShapeValuesPredicate
- java.lang.Object
-
- org.apache.lucene.spatial.util.ShapeValuesPredicate
-
- All Implemented Interfaces:
SegmentCacheable
public class ShapeValuesPredicate extends Object implements SegmentCacheable
Compares a shape from a providedShapeValuesSourcewith a given Shape and sees if it matches a givenSpatialOperation(the predicate).Consumers should call
iterator(LeafReaderContext, DocIdSetIterator)to obtain aTwoPhaseIteratorover a particularDocIdSetIterator. The initial DocIdSetIterator will be used as the approximation, and theSpatialOperationcomparison will only be performed inTwoPhaseIterator.matches()- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description ShapeValuesPredicate(ShapeValuesSource shapeValuesource, SpatialOperation op, org.locationtech.spatial4j.shape.Shape queryShape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanisCacheable(LeafReaderContext ctx)TwoPhaseIteratoriterator(LeafReaderContext ctx, DocIdSetIterator approximation)StringtoString()
-
-
-
Constructor Detail
-
ShapeValuesPredicate
public ShapeValuesPredicate(ShapeValuesSource shapeValuesource, SpatialOperation op, org.locationtech.spatial4j.shape.Shape queryShape)
- Parameters:
shapeValuesource- Must yieldShapeinstances from its objectVal(doc). If null then the result is false. This is the left-hand (indexed) side.op- the predicatequeryShape- The shape on the right-hand (query) side.
-
-
Method Detail
-
iterator
public TwoPhaseIterator iterator(LeafReaderContext ctx, DocIdSetIterator approximation) throws IOException
- Throws:
IOException
-
isCacheable
public boolean isCacheable(LeafReaderContext ctx)
- Specified by:
isCacheablein interfaceSegmentCacheable
-
-