org.apache.lucene.spatial.prefix

## Class ContainsPrefixTreeQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.spatial.prefix.AbstractPrefixTreeQuery
    - - org.apache.lucene.spatial.prefix.ContainsPrefixTreeQuery

-     public class ContainsPrefixTreeQuery
      extends AbstractPrefixTreeQuery

  Finds docs where its indexed shape `CONTAINS` the query shape. For use on `RecursivePrefixTreeStrategy`.
  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.AbstractPrefixTreeQuery

      `AbstractPrefixTreeQuery.BaseTermsEnumTraverser`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `multiOverlappingIndexedShapes` If the spatial data for a document is comprised of multiple overlapping or adjacent parts, it might fail to match a query shape when doing the CONTAINS predicate when the sum of those shapes contain the query shape but none do individually.

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

      `detailLevel, fieldName, grid, queryShape`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContainsPrefixTreeQuery(org.locationtech.spatial4j.shape.Shape queryShape, String fieldName, SpatialPrefixTree grid, int detailLevel, boolean multiOverlappingIndexedShapes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `protected DocIdSet` | `getDocIdSet(LeafReaderContext context)`
    `int` | `hashCode()`
    `String` | `toString(String field)`

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

      `createWeight, visit`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `classHash, rewrite, sameClassAs, toString`

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

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

- - ### Field Detail

    - #### multiOverlappingIndexedShapes

          protected final boolean multiOverlappingIndexedShapes

      If the spatial data for a document is comprised of multiple overlapping or adjacent parts, it might fail to match a query shape when doing the CONTAINS predicate when the sum of those shapes contain the query shape but none do individually. Set this to false to increase performance if you don't care about that circumstance (such as if your indexed data doesn't even have such conditions). See LUCENE-5062.

  - ### Constructor Detail

    - #### ContainsPrefixTreeQuery

          public ContainsPrefixTreeQuery(org.locationtech.spatial4j.shape.Shape queryShape,
                                         String fieldName,
                                         SpatialPrefixTree grid,
                                         int detailLevel,
                                         boolean multiOverlappingIndexedShapes)

  - ### Method Detail

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `AbstractPrefixTreeQuery`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractPrefixTreeQuery`

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `Query`

    - #### getDocIdSet

          protected DocIdSet getDocIdSet(LeafReaderContext context)
                                  throws IOException

      Specified by:
        `getDocIdSet` in class `AbstractPrefixTreeQuery`
      Throws:
        `IOException`

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