- Issue created by @pinkonomy
- First commit to issue fork.
- Status changed to Needs work
about 1 year ago 1:14pm 15 November 2023 First, to answer the question, no the current version of the module does not support spatial search.
So I started working on a submodule, to integrate with the Search API Location (FYI the current view integration in that module doesn't work correctly with Drupal 10.1, you need to use the dev version, but it will probably be fixed soon).
To integrate that functionality, I had to add some events to the Search API Meilisearch backend since I had to modify indexing, searching, and filtering. Still, I don't think the location functionality should be part of the parent module since not everyone will need Search API Location in the first place.
A few things, Meilisearch expects geosearch to be saved in a field called
_geo
formatted as JSON containing lat & lng variables. One way this could have been solved was to force the machine name to always be_geo
, but this didn't feel right to me, so now I do these translations on the fly.
The second thing and this is also the reason I can do the previous thing. Meilisearch expects only one spatial field, so I also validate that people can't add multiple spatial fields per index.While I think the functionality is finished, you can index location data, it correctly returns it, and filtering with it also works. The tests for new functionality still have to be added, so marking it as
needs work
. Also, the tests are failing because of 📌 Fix gitlab-ci Needs reviewNoticed, that there is a way to sort by geo data. Looking into implementing that too.
- Status changed to Needs review
12 months ago 10:28am 17 November 2023 Implemented sorting. Also had to implement many more changes, than what Search API Location expects, but sorting should now work. Remember how meilisearch implements geo sorting, it's probably going to be the last factor when it's collecting relevant data.
- Status changed to Needs work
12 months ago 10:24pm 26 November 2023