Lucene - Core
  1. Lucene - Core
  2. LUCENE-6190

spatial pointsOnly flag shouldn't force predicate to Intersects

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1
    • Component/s: modules/spatial
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In the process of testing the pointsOnly flag, I realized RPT's optimization to force the predicate to Intersects from Within|Contains isn't sound. In the case of Within, this is only valid if there is one point per document but not multiple (since all points on a doc need to intersect the query shape), and for Contains it was simply wrong.

      Note that the strategy has no multi-valued hint or some-such. If it did, then if !multiValued && pointsOnly, then Within could be changed to Intersects. Regardless, swapping the predicate can be done at a higher level (Solr/ES).

        Activity

        Hide
        David Smiley added a comment -

        This patch removes the predicate swap by RPT, and enhances existing randomized testing for pointsOnly. And it refactored the "hasIndexedLeaves" flag (generally !pointsOnly) to be passed through to WithinPrefixTreeFilter and moved it from AbstractVisitingPrefixTreeFilter.VisitorTemplate to its parent class.

        In the process, I fixed a bug in which WithinPrefixTreeFilter was missing equals/hashcode. It would have only been a problem if you were explicitly creating WithinPrefixTreeFilter with custom buffered query distance args.

        Show
        David Smiley added a comment - This patch removes the predicate swap by RPT, and enhances existing randomized testing for pointsOnly. And it refactored the "hasIndexedLeaves" flag (generally !pointsOnly) to be passed through to WithinPrefixTreeFilter and moved it from AbstractVisitingPrefixTreeFilter.VisitorTemplate to its parent class. In the process, I fixed a bug in which WithinPrefixTreeFilter was missing equals/hashcode. It would have only been a problem if you were explicitly creating WithinPrefixTreeFilter with custom buffered query distance args.
        Hide
        ASF subversion and git services added a comment -

        Commit 1656473 from David Smiley in branch 'dev/trunk'
        [ https://svn.apache.org/r1656473 ]

        LUCENE-6190: PrefixTreeStrategy pointsOnly bug: don't switch predicate
        Also refactored placement of hasIndexedLeaves, and fixed a minor equals/hashcode bug.

        Show
        ASF subversion and git services added a comment - Commit 1656473 from David Smiley in branch 'dev/trunk' [ https://svn.apache.org/r1656473 ] LUCENE-6190 : PrefixTreeStrategy pointsOnly bug: don't switch predicate Also refactored placement of hasIndexedLeaves, and fixed a minor equals/hashcode bug.
        Hide
        ASF subversion and git services added a comment -

        Commit 1656475 from David Smiley in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1656475 ]

        LUCENE-6190: PrefixTreeStrategy pointsOnly bug: don't switch predicate
        Also refactored placement of hasIndexedLeaves, and fixed a minor equals/hashcode bug.

        Show
        ASF subversion and git services added a comment - Commit 1656475 from David Smiley in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1656475 ] LUCENE-6190 : PrefixTreeStrategy pointsOnly bug: don't switch predicate Also refactored placement of hasIndexedLeaves, and fixed a minor equals/hashcode bug.
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development