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

Sorting by min of two geodist functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 8.7
    • spatial
    • None

    Description

      Previously using geo field with type LatLonType you could implement a query like

      /select?q=*:*&fl=ID&fq={!geofilt}&d=50&pt=53.4721936,-2.24703&sfield=MAIN_LOCATION&sort=min(geodist(), geodist(ALT_LOCATION,53.4721936,-2.24703)) asc

      to sort results on minium distance from multiple different locations. Moving the fields to advised LatLonPointSpatialField gives

      "geodist() does not support field names in its arguments when stated fields are solr.LatLonPointSpatialField spatial type, requires sfield param instead"

      This has been reviewed before SOLR-11601 but not for my actual actual use-case so it seems the choice was to just change the error message rather than to implement the previous functionality. Can this be re-reviewed or let me know if there is another way to achieve the same result.

       

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              spstorey Shaun Storey
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m