Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9270

Let spatialContextFactory attribute accept "JTS" and the old value

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2
    • Component/s: spatial
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      The spatialContextFactory attribute (sometimes set on RPT field) is interpreted by a Spatial4j SpatialContextFactory and is expected to be a class name. In the Solr adapter, for ease of use, it would be nice to accept simply "JTS".

      Furthermore the older value in 5x should be accepted with a logged warning. That would make upgrading easier.

      1. SOLR-9270.patch
        2 kB
        David Smiley

        Activity

        Hide
        dsmiley David Smiley added a comment -

        This patch file adds a "JTS" alias, and it also rewrites any attribute value containing "com.spatial4j.core" with "org.locationtech.spatial4j". The spatialContextFactory isn't the only attribute this applies to, there are some others: https://locationtech.github.io/spatial4j/apidocs/com/spatial4j/core/context/SpatialContextFactory.html

        There is no test as I don't want to bring in a JTS dependency. I tested manually, and observed the expected warnings when the old class name is referenced.

        I'll commit this Friday. I plan to retroactively include a note in the CHANGES.txt under 6.0 migrating mentioning the change in package name and that going to 6.2 may be easier due to this change. I'll also update the ref guide.

        Show
        dsmiley David Smiley added a comment - This patch file adds a "JTS" alias, and it also rewrites any attribute value containing "com.spatial4j.core" with "org.locationtech.spatial4j". The spatialContextFactory isn't the only attribute this applies to, there are some others: https://locationtech.github.io/spatial4j/apidocs/com/spatial4j/core/context/SpatialContextFactory.html There is no test as I don't want to bring in a JTS dependency. I tested manually, and observed the expected warnings when the old class name is referenced. I'll commit this Friday. I plan to retroactively include a note in the CHANGES.txt under 6.0 migrating mentioning the change in package name and that going to 6.2 may be easier due to this change. I'll also update the ref guide.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 360b9a35282a005fd4a9acddfafb3814592baba8 in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=360b9a3 ]

        SOLR-9270: spatialContextFactory now accepts "JTS" alias. Spatial config attributes with old package names are now rewritten with a warning.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 360b9a35282a005fd4a9acddfafb3814592baba8 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=360b9a3 ] SOLR-9270 : spatialContextFactory now accepts "JTS" alias. Spatial config attributes with old package names are now rewritten with a warning.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit da25555baf993c70fcac6ff988bdfc603e6ebb43 in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=da25555 ]

        SOLR-9270: spatialContextFactory now accepts "JTS" alias. Spatial config attributes with old package names are now rewritten with a warning.
        (cherry picked from commit 360b9a3)

        Show
        jira-bot ASF subversion and git services added a comment - Commit da25555baf993c70fcac6ff988bdfc603e6ebb43 in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=da25555 ] SOLR-9270 : spatialContextFactory now accepts "JTS" alias. Spatial config attributes with old package names are now rewritten with a warning. (cherry picked from commit 360b9a3)
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk close resolved issues after 6.2.0 release.

        Show
        mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development