When trying to sort results by Search API Location field, no results is returned at all. It seems that distance sorting is not supported at the moment.

Comments

Alex Bukach created an issue. See original summary.

alex.bukach’s picture

Assigned: alex.bukach » Unassigned
Status: Active » Needs review
StatusFileSize
new1.29 KB

Here's a patch providing Search API Location sort support.

  • skek committed d66c214 on 7.x-1.x authored by Alex Bukach
    Issue #2550047 by Alex Bukach: Search API Location: Distance sort
    
skek’s picture

Status: Needs review » Fixed
alex.bukach’s picture

Status: Fixed » Needs review
StatusFileSize
new869 bytes

Thanks for committing it so fast, @skek! I have found a minor issue with the previous patch: it causes a warning when $query->getOption('search_api_location') is empty. Here's one more patch against the current version.

  • skek committed 11facc7 on authored by Alex Bukach
    Issue #2550047 by Alex Bukach: Search API Location: Distance sort
    
skek’s picture

Status: Needs review » Fixed

Thanks for the patch @Alex Bukach! Applied!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

alex.bukach’s picture

Assigned: Unassigned » alex.bukach
Status: Closed (fixed) » Needs work

I have found an issue with distance sort: if the search point is not set, then attempt to execute distance sorting makes Elasticsearch throw an exception:

ElasticsearchIllegalArgumentException[can't sort on geo_point field without using specific sorting feature, like geo_distance

alex.bukach’s picture

Assigned: alex.bukach » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.66 KB

  • skek committed b78b1ae on 7.x-1.x authored by Alex Bukach
    Issue #2550047 by Alex Bukach: Search API Location: Distance sort
    
skek’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.