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 of `PrefixTreeStrategy` using a large `TermInSetQuery` of all the cells from `SpatialPrefixTree.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 and 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 and Description
    `TermQueryPrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Query` | `makeQuery(SpatialArgs args)` Make a Query based principally on `SpatialOperation` and `Shape` from the supplied `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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### simplifyIndexedCells

          protected boolean simplifyIndexedCells

  - ### Constructor Detail

    - #### TermQueryPrefixTreeStrategy

          public TermQueryPrefixTreeStrategy(SpatialPrefixTree grid,
                                             String fieldName)

  - ### Method Detail

    - #### newCellToBytesRefIterator

          protected CellToBytesRefIterator newCellToBytesRefIterator()

      Overrides:
        `newCellToBytesRefIterator` in class `PrefixTreeStrategy`

    - #### makeQuery

          public Query makeQuery(SpatialArgs args)

      Description copied from class: `SpatialStrategy`
      Make a Query based principally on `SpatialOperation` and `Shape` from the supplied `args`. It should be constant scoring of 1.
      Specified by:
        `makeQuery` in class `SpatialStrategy`

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.