Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5408

SerializedDVStrategy -- match geometries in DocValues

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.7, 6.0
    • modules/spatial
    • None
    • New

    Description

      I've started work on a new SpatialStrategy implementation I'm tentatively calling SerializedDVStrategy. It's similar to the JtsGeoStrategy in Spatial-Solr-Sandbox but a little different in the details – certainly faster. Using Spatial4j 0.4's BinaryCodec, it'll serialize the shape to bytes (for polygons this in internally WKB format) and the strategy will put it in a BinaryDocValuesField. In practice the shape is likely a polygon but it needn't be. Then I'll implement a Filter that returns a DocIdSetIterator that evaluates a given document passed via advance(docid)) to see if the query shape matches a shape in DocValues. It's improper usage for it to be used in a situation where it will evaluate every document id via nextDoc(). And in practice the DocValues format chosen should be a disk resident one since each value tends to be kind of big.

      This spatial strategy in and of itself has no index; it's O(N) where N is the number of documents that get passed thru it. So it should be placed last in the query/filter tree so that the other queries limit the documents it needs to see. At a minimum, another query/filter to use in conjunction is another SpatialStrategy like RecursivePrefixTreeStrategy.

      Eventually once the PrefixTree grid encoding has a little bit more metadata, it will be possible to further combine the grid & this strategy in such a way that many documents won't need to be checked against the serialized geometry.

      Attachments

        1. LUCENE-5408_GeometryStrategy.patch
          9 kB
          David Smiley
        2. LUCENE-5408_SerializedDVStrategy.patch
          30 kB
          David Smiley

        Issue Links

          Activity

            People

              dsmiley David Smiley
              dsmiley David Smiley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: