Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 4.10, 6.0
    • Component/s: modules/spatial
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The spatial predicate "IsDisjointTo" is almost the same as the inverse of "Intersects", except that it shouldn't match documents without spatial data. In another sense it's as if the query shape were inverted.

      DisjointSpatialFilter is a utility filter that works (or worked, rather) by using the FieldCache to see which documents have spatial data (getDocsWithField()). Calculating that was probably very slow but it was at least cacheable. Since LUCENE-5666 (v5/trunk only), Rob replaced this to use DocValues. However for some SpatialStrategies (PrefixTree based) it wouldn't make any sense to use DocValues just so that at search time you could call getDocsWithField() when there's no other need for the un-inversion (e.g. no need to lookup terms by document).

      Perhaps an immediate fix is simply to revert the change made to DisjointSpatialFilter so that it uses the FieldCache again, if that works (though it's not public?). But stepping back a bit, this DisjointSpatialFilter is really something unfortunate that doesn't work as well as it could because it's not at the level of Solr or ES – that is, there's no access to a filter-cache. So I propose I simply remove it, and if a user wants to do this for real, they should index a boolean field marking wether there's spatial data and then combine that with a NOT and Intersects, in a straight-forward way.

      Alternatively, some sort of inverting query shape could be developed, although it wouldn't work with the SpatialPrefixTree technique because there is no edge distinction – the edge matches normally and notwithstanding changes to RPT algorithms it would also match the edge of an inverted shape.

        Activity

        Hide
        Ryan McKinley added a comment -

        +1 to remove DisjointSpatialFilter

        using another boolean field to represent if a shape exists seems very easy and this would avoid using the FieldCache

        Show
        Ryan McKinley added a comment - +1 to remove DisjointSpatialFilter using another boolean field to represent if a shape exists seems very easy and this would avoid using the FieldCache
        Hide
        David Smiley added a comment -

        Ok; I'm going to mark it deprecated, and add an Ignore annotation to RPT's Disjoint test. And I'll have the trunk RecursivePrefixTreeStrategy remove support for it, leaving it in 4x.

        Note to self: I do think I could make a simple variation of IntersectsPrefixTreeFilter (IPTF isn't much code any way) to implement disjoint. Perhaps I'll do that sometime but not now. But even if I did... it wouldn't be as fast as what should be recommended (what I said in the description):

        and if a user wants to do this for real, they should index a boolean field marking wether there's spatial data and then combine that with a NOT and Intersects, in a straight-forward way.

        Show
        David Smiley added a comment - Ok; I'm going to mark it deprecated, and add an Ignore annotation to RPT's Disjoint test. And I'll have the trunk RecursivePrefixTreeStrategy remove support for it, leaving it in 4x. Note to self: I do think I could make a simple variation of IntersectsPrefixTreeFilter (IPTF isn't much code any way) to implement disjoint. Perhaps I'll do that sometime but not now. But even if I did... it wouldn't be as fast as what should be recommended (what I said in the description): and if a user wants to do this for real, they should index a boolean field marking wether there's spatial data and then combine that with a NOT and Intersects, in a straight-forward way.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5692: Deprecate DisjointSpatialFilter; RPT stops using it

        Show
        ASF subversion and git services added a comment - Commit 1608488 from David Smiley in branch 'dev/trunk' [ https://svn.apache.org/r1608488 ] LUCENE-5692 : Deprecate DisjointSpatialFilter; RPT stops using it
        Hide
        ASF subversion and git services added a comment -

        Commit 1608499 from David Smiley in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1608499 ]

        LUCENE-5692: Deprecate DisjointSpatialFilter; (in 4x RPT still uses it)

        Show
        ASF subversion and git services added a comment - Commit 1608499 from David Smiley in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1608499 ] LUCENE-5692 : Deprecate DisjointSpatialFilter; (in 4x RPT still uses it)
        Hide
        David Smiley added a comment -

        I put the CHANGES.txt in the 5x area because there RPT removes support for it. It's debatable, but this is a fairly minor thing.

        Show
        David Smiley added a comment - I put the CHANGES.txt in the 5x area because there RPT removes support for it. It's debatable, but this is a fairly minor thing.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5692: Removed deprecated DisjointSpatialFilter on trunk. Moved CHANGES.txt deprecation note to 4.10

        Show
        ASF subversion and git services added a comment - Commit 1608501 from David Smiley in branch 'dev/trunk' [ https://svn.apache.org/r1608501 ] LUCENE-5692 : Removed deprecated DisjointSpatialFilter on trunk. Moved CHANGES.txt deprecation note to 4.10
        Hide
        ASF subversion and git services added a comment -

        Commit 1608503 from David Smiley in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1608503 ]

        LUCENE-5692: Moved deprecation CHANGES.txt note to 4.10

        Show
        ASF subversion and git services added a comment - Commit 1608503 from David Smiley in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1608503 ] LUCENE-5692 : Moved deprecation CHANGES.txt note to 4.10
        Hide
        David Smiley added a comment -

        On second thought it makes more sense to put deprecation note into CHANGES.txt for 4x, and delete from trunk, so that's what I did.

        Show
        David Smiley added a comment - On second thought it makes more sense to put deprecation note into CHANGES.txt for 4x, and delete from trunk, so that's what I did.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5692: remove need for uninversion for RandomSpatialOpFuzzyPrefixTreeTest

        Show
        ASF subversion and git services added a comment - Commit 1609139 from David Smiley in branch 'dev/trunk' [ https://svn.apache.org/r1609139 ] LUCENE-5692 : remove need for uninversion for RandomSpatialOpFuzzyPrefixTreeTest
        Hide
        ASF subversion and git services added a comment -

        Commit 1609189 from David Smiley in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1609189 ]

        LUCENE-5692: remove need for uninversion for RandomSpatialOpFuzzyPrefixTreeTest

        Show
        ASF subversion and git services added a comment - Commit 1609189 from David Smiley in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1609189 ] LUCENE-5692 : remove need for uninversion for RandomSpatialOpFuzzyPrefixTreeTest

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development