The problem with search_api bounding box support is two-fold:

  1. it can deal with bounding boxes in different ways depending on the search backend (spatial support).
  2. search api doesn't support mysql GROUP BY, JOIN nor AND/OR conditions.

BBOX filtering was initially addressed in #2395407: Bbox argument: wrapping doesn't apply to all coordinate systems. But none of the patches put forward in that issue ever dealt with search api bbox support or wrapping around geodes.

For more information on attempts to implement spatial support see: #1839462: BBox argument handler doesn't work with GROUP BY, #2662548: Support Plugins for Views Aggregate and #2660312: Support Spatial Aggregates in Views.

If the search api backend supports some form of geo calculations natively, it should supply a data alteration plugin #1254452: Data alterations and processors. For instance:

But at the very least search api should have a fallback method no reliant on any spatial support by the backend and by simply filtering on values post factum.

Comments

basvredeling created an issue. See original summary.

basvredeling’s picture

Issue summary: View changes
basvredeling’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new13.64 KB

After some deliberation, I suggest creating a subclass for search api bbox argument handling.
Attached is a concept patch. Please review. It adds a new argument handler specifically for search api bbox filtering.

I've tested this myself with a search_api_db index, with geofield lat lon values added to the index.