Package org.apache.lucene.spatial.prefix
Class TermQueryPrefixTreeStrategy
- java.lang.Object
-
- org.apache.lucene.spatial.SpatialStrategy
-
- org.apache.lucene.spatial.prefix.PrefixTreeStrategy
-
- org.apache.lucene.spatial.prefix.TermQueryPrefixTreeStrategy
-
public class TermQueryPrefixTreeStrategy extends PrefixTreeStrategy
A basic implementation ofPrefixTreeStrategy
using a largeTermInSetQuery
of all the cells fromSpatialPrefixTree.getTreeCellIterator(org.locationtech.spatial4j.shape.Shape, int)
. It only supports the search of indexed Point shapes.The precision of query shapes (distErrPct) is an important factor in using this Strategy. If the precision is too precise then it will result in many terms which will amount to a slower query.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.spatial.prefix.PrefixTreeStrategy
PrefixTreeStrategy.ShapeTokenStream
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
simplifyIndexedCells
-
Fields inherited from class org.apache.lucene.spatial.prefix.PrefixTreeStrategy
defaultFieldValuesArrayLen, distErrPct, FIELD_TYPE, grid, pointsOnly
-
Fields inherited from class org.apache.lucene.spatial.SpatialStrategy
ctx
-
-
Constructor Summary
Constructors Constructor Description TermQueryPrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Query
makeQuery(SpatialArgs args)
protected CellToBytesRefIterator
newCellToBytesRefIterator()
-
Methods inherited from class org.apache.lucene.spatial.prefix.PrefixTreeStrategy
calcFacets, createCellIteratorToIndex, createIndexableFields, createIndexableFields, createIndexableFields, getDistErrPct, getGrid, isPointShape, isPointsOnly, makeDistanceValueSource, setDefaultFieldValuesArrayLen, setDistErrPct, setPointsOnly, tokenStream
-
Methods inherited from class org.apache.lucene.spatial.SpatialStrategy
getFieldName, getSpatialContext, makeDistanceValueSource, makeRecipDistanceValueSource, toString
-
-
-
-
Constructor Detail
-
TermQueryPrefixTreeStrategy
public TermQueryPrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)
-
-
Method Detail
-
newCellToBytesRefIterator
protected CellToBytesRefIterator newCellToBytesRefIterator()
- Overrides:
newCellToBytesRefIterator
in classPrefixTreeStrategy
-
makeQuery
public Query makeQuery(SpatialArgs args)
Description copied from class:SpatialStrategy
Make a Query based principally onSpatialOperation
andShape
from the suppliedargs
. It should be constant scoring of 1.- Specified by:
makeQuery
in classSpatialStrategy
-
-