Allow simple Boundary Box query.

Created on 19 May 2024, about 1 month ago
Updated 8 June 2024, 20 days ago

See https://solr.apache.org/guide/solr/latest/query-guide/spatial-search.htm...

you can query spatial fields by boundary like this: &q=*:*&fq=store:[45,-94 TO 46,-93] and importantly, this works with both, RPT and simple LatLng fields!

In Search API Solr the latter fails though. The only way is to:

$location_options = [[
      'field' => $this->realField,
      'geom' => "[$lat_south_west,$lng_south_west TO $lat_north_east,$lng_north_east]",
    ]];
    $query->setOption('search_api_rpt', $location_options);

and that
1.) implies RPT, which is not used then and more importantly
2.) because the facet heatmap support is mandatory enabled, and that only works with RPT fields and therefor fails with a status 400.

See SearchApiSolrBackend:setRpt:4436.

So possible tasks:

- Just use setRpt anyway, but depending on field type, add heatmap or not
or
- make setSpatial smarter to instead of proximity filtering, do boundary filtering?

πŸ“Œ Task
Status

Needs review

Version

4.3

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany ChristianAdamski Berlin, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024