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

add newDistanceSort to sandbox LatLonPoint

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1, master (7.0)
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This field does not support sorting by distance, which is a very common use case.

      We can add LatLonPoint.newDistanceSort(field, latitude, longitude) which returns a suitable SortField. There are a lot of optimizations esp when e.g. the priority queue gets full to avoid tons of haversin() computations.

      Also, we can make use of the SortedNumeric data to switch newDistanceQuery/newPolygonQuery to the two-phase iterator api, so they aren't doing haversin() calls on bkd leaf nodes. It should look a lot like LUCENE-7019

        Activity

        Hide
        rcmuir Robert Muir added a comment -

        Here is a patch. It uses the slowest possible algorithm but has a decent test.

        Show
        rcmuir Robert Muir added a comment - Here is a patch. It uses the slowest possible algorithm but has a decent test.
        Hide
        mikemccand Michael McCandless added a comment -

        +1, very simple!

        Show
        mikemccand Michael McCandless added a comment - +1, very simple!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 80fe00ba18ac1f834028eb0064115a00bafe1f20 in lucene-solr's branch refs/heads/master from Robert Muir
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=80fe00b ]

        LUCENE-7099: improve test to exercise searchAfter

        Show
        jira-bot ASF subversion and git services added a comment - Commit 80fe00ba18ac1f834028eb0064115a00bafe1f20 in lucene-solr's branch refs/heads/master from Robert Muir [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=80fe00b ] LUCENE-7099 : improve test to exercise searchAfter
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ae866b01499a1474a2178749025c2c571b6a4777 in lucene-solr's branch refs/heads/branch_6x from Robert Muir
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae866b0 ]

        LUCENE-7099: improve test to exercise searchAfter

        Show
        jira-bot ASF subversion and git services added a comment - Commit ae866b01499a1474a2178749025c2c571b6a4777 in lucene-solr's branch refs/heads/branch_6x from Robert Muir [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae866b0 ] LUCENE-7099 : improve test to exercise searchAfter
        Hide
        mikemccand Michael McCandless added a comment -

        Robert Muir can this be resolved now?

        Show
        mikemccand Michael McCandless added a comment - Robert Muir can this be resolved now?
        Hide
        hossman Hoss Man added a comment -

        Manually correcting fixVersion per Step #S5 of LUCENE-7271

        Show
        hossman Hoss Man added a comment - Manually correcting fixVersion per Step #S5 of LUCENE-7271

          People

          • Assignee:
            Unassigned
            Reporter:
            rcmuir Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development