public class RecursivePrefixTreeStrategy extends PrefixTreeStrategy
PrefixTreeStrategy
which uses AbstractVisitingPrefixTreeFilter
.
This strategy has support for searching non-point shapes (note: not tested).
Even a query shape with distErrPct=0 (fully precise to the grid) should have
good performance for typical data, unless there is a lot of indexed data
coincident with the shape's edge.Modifier and Type | Field and Description |
---|---|
protected boolean |
multiOverlappingIndexedShapes |
protected boolean |
pointsOnly |
protected int |
prefixGridScanLevel |
protected boolean |
pruneLeafyBranches |
defaultFieldValuesArrayLen, distErrPct, FIELD_TYPE, grid
ctx
Constructor and Description |
---|
RecursivePrefixTreeStrategy(SpatialPrefixTree grid,
String fieldName) |
Modifier and Type | Method and Description |
---|---|
protected TokenStream |
createTokenStream(com.spatial4j.core.shape.Shape shape,
int detailLevel) |
Filter |
makeFilter(SpatialArgs args)
|
void |
setMultiOverlappingIndexedShapes(boolean multiOverlappingIndexedShapes)
|
void |
setPointsOnly(boolean pointsOnly)
True if only indexed points shall be supported.
|
void |
setPrefixGridScanLevel(int prefixGridScanLevel)
Sets the grid level [1-maxLevels] at which indexed terms are scanned brute-force
instead of by grid decomposition.
|
void |
setPruneLeafyBranches(boolean pruneLeafyBranches)
An optional hint affecting non-point shapes: it will
simplify/aggregate sets of complete leaves in a cell to its parent, resulting in ~20-25%
fewer indexed cells.
|
String |
toString() |
createIndexableFields, createIndexableFields, getDistErrPct, getGrid, makeDistanceValueSource, setDefaultFieldValuesArrayLen, setDistErrPct
getFieldName, getSpatialContext, makeDistanceValueSource, makeQuery, makeRecipDistanceValueSource
protected int prefixGridScanLevel
protected boolean pruneLeafyBranches
protected boolean pointsOnly
protected boolean multiOverlappingIndexedShapes
public RecursivePrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)
public void setPrefixGridScanLevel(int prefixGridScanLevel)
prefixGridScanLevel
- 1 to maxLevelspublic void setPointsOnly(boolean pointsOnly)
IntersectsPrefixTreeFilter.hasIndexedLeaves
.public void setMultiOverlappingIndexedShapes(boolean multiOverlappingIndexedShapes)
public void setPruneLeafyBranches(boolean pruneLeafyBranches)
public String toString()
toString
in class SpatialStrategy
protected TokenStream createTokenStream(com.spatial4j.core.shape.Shape shape, int detailLevel)
createTokenStream
in class PrefixTreeStrategy
public Filter makeFilter(SpatialArgs args)
SpatialStrategy
SpatialOperation
and Shape
from the supplied args
.
If a subclasses implements
SpatialStrategy.makeQuery(org.apache.lucene.spatial.query.SpatialArgs)
then this method could be simply:
return new QueryWrapperFilter(makeQuery(args).getQuery());
makeFilter
in class SpatialStrategy
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.