org.apache.lucene.spatial.prefix

## Class RecursivePrefixTreeStrategy

- java.lang.Object
- - org.apache.lucene.spatial.SpatialStrategy
  - - org.apache.lucene.spatial.prefix.PrefixTreeStrategy
    - - org.apache.lucene.spatial.prefix.RecursivePrefixTreeStrategy

-     public class RecursivePrefixTreeStrategy
      extends PrefixTreeStrategy

  A `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.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.spatial.prefix.PrefixTreeStrategy

      `defaultFieldValuesArrayLen, distErrPct, FIELD_TYPE, grid, simplifyIndexedCells`

    - ### Fields inherited from class org.apache.lucene.spatial.SpatialStrategy

      `ctx`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RecursivePrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Filter` | `makeFilter(SpatialArgs args)` Make a Filter based principally on `SpatialOperation` and `Shape` from the supplied `args`.
    `void` | `setPrefixGridScanLevel(int prefixGridScanLevel)` Sets the grid level [1-maxLevels] at which indexed terms are scanned brute-force instead of by grid decomposition.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.spatial.prefix.PrefixTreeStrategy

      `createIndexableFields, createIndexableFields, getDistErrPct, getGrid, makeDistanceValueSource, setDefaultFieldValuesArrayLen, setDistErrPct`

    - ### Methods inherited from class org.apache.lucene.spatial.SpatialStrategy

      `getFieldName, getSpatialContext, makeQuery, makeRecipDistanceValueSource`

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

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

- - ### Constructor Detail

    - #### RecursivePrefixTreeStrategy

          public RecursivePrefixTreeStrategy(SpatialPrefixTree grid,
                                     String fieldName)

  - ### Method Detail

    - #### setPrefixGridScanLevel

          public void setPrefixGridScanLevel(int prefixGridScanLevel)

      Sets the grid level [1-maxLevels] at which indexed terms are scanned brute-force instead of by grid decomposition. By default this is maxLevels - 4. The final level, maxLevels, is always scanned.
      Parameters:
        `prefixGridScanLevel` - 1 to maxLevels

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `SpatialStrategy`

    - #### makeFilter

          public Filter makeFilter(SpatialArgs args)

      Description copied from class: `SpatialStrategy`
      Make a Filter based principally on `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());

      Specified by:
        `makeFilter` in class `SpatialStrategy`

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