Lucene - Core
  1. Lucene - Core
  2. LUCENE-4794

Refactor Spatial RecursivePrefixTreeFilter algorithm for extension

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2, 6.0
    • Component/s: modules/spatial
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      In the process of implementing algorithms on the SpatialPrefixTree indexed field like "Within" or some variations of Intersects that say collect the distance as side-effect, I find that I need near-copies of the code in RecursivePrefixTreeFilter. RPTF is pretty intense with lots of optimizations. So I refactored out the algorithm such that it makes implementing new algorithms much easier yet benefits from the logic in there.

      Patch to follow...

        Issue Links

          Activity

          Hide
          David Smiley added a comment -

          Patch summary:

          • IntersectsPrefixTreeFilter: replaces RecursivePrefixTreeFilter but has little code since most logic is in its superclass now.
          • AbstractVisitingPrefixTreeFilter: Most of the former logic is here, with extensibility hooks.
            • A new optimization that skips calls to seek() when the cell is known to precede the next term.
            • The former stack / LinkedList is now a tree structure using inner class "VNode". Not really leveraged yet.
          • AbstractPrefixTreeFilter: The superclass of AbstractVisitingPrefixTreeFilter – doesn't do much but hold essential state & implement equals & hashCode. Arguably isn't needed as separate but is useful for a Contains algorithm (not present, will follow in a few weeks) that doesn't use AbstractVisitingPrefixTreeFilter.
          • tree/Node.java: decoupled shapeRel & isLeaf into separate fields instead of isLeaf being true IFF shapeRel==WITHIN. This is a small thing unrelated to the rest.

          The tests pass. I'll commit in a few days if there is no feedback.

          Show
          David Smiley added a comment - Patch summary: IntersectsPrefixTreeFilter: replaces RecursivePrefixTreeFilter but has little code since most logic is in its superclass now. AbstractVisitingPrefixTreeFilter: Most of the former logic is here, with extensibility hooks. A new optimization that skips calls to seek() when the cell is known to precede the next term. The former stack / LinkedList is now a tree structure using inner class "VNode". Not really leveraged yet. AbstractPrefixTreeFilter: The superclass of AbstractVisitingPrefixTreeFilter – doesn't do much but hold essential state & implement equals & hashCode. Arguably isn't needed as separate but is useful for a Contains algorithm (not present, will follow in a few weeks) that doesn't use AbstractVisitingPrefixTreeFilter. tree/Node.java: decoupled shapeRel & isLeaf into separate fields instead of isLeaf being true IFF shapeRel==WITHIN. This is a small thing unrelated to the rest. The tests pass. I'll commit in a few days if there is no feedback.
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] David Wayne Smiley
          http://svn.apache.org/viewvc?view=revision&revision=1450010

          LUCENE-4794 Spatial PrefixTree traversal abstraction

          Show
          Commit Tag Bot added a comment - [trunk commit] David Wayne Smiley http://svn.apache.org/viewvc?view=revision&revision=1450010 LUCENE-4794 Spatial PrefixTree traversal abstraction
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] David Wayne Smiley
          http://svn.apache.org/viewvc?view=revision&revision=1450011

          LUCENE-4794 Spatial PrefixTree traversal abstraction

          Show
          Commit Tag Bot added a comment - [branch_4x commit] David Wayne Smiley http://svn.apache.org/viewvc?view=revision&revision=1450011 LUCENE-4794 Spatial PrefixTree traversal abstraction
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.

            People

            • Assignee:
              David Smiley
              Reporter:
              David Smiley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development