Hey everyone,
I’m running into some issues with the Algolia Search V2.0 Plugin around Geo-Search
Following Use Case:
I have those fields in a user form
- Post Code (only three digits to make it data-privacy compliant)
- Range (how far around the lat/lng sth. has to be)
-
-
- → some other criteria, that are not that relevant. All of them are used in “Filter”
-
I calculate the lat/lng of the post code through an api, save it into a database field and that field is referenced in the “Around Lat-Lng” field and the range field is also saved and is referenced in the “Around Radius” field
Once user fills out the form and clicks on submit, he/she is taken to the result page. All of that works just fine and results are as expected.
Now my problem:
I have real-time filtering available for clients, so they can update the filter criteria on the result page in real-time and results get updated accordingly. I use the auto-bind feature for that instead of states, to make maintenance a bit easier for me.
If I update any of the fields from 3 - 10, which are used in the plugin as filter criteria, it works like a charm. Any update on those results in a instant update of the search results.
However, for the geo-fields, I run into some issues:
When I update the post code, calculate a new lat/lng and save that to be referenced by the plugin, I see in the debugger, that the new value is there, but the tool is not refreshing the data accordingly. Once i reload the page, i get the results as expected.
Same goes for range update. New value is there in the debugger, but results arent being updated dynamically, only if i reload the page
So, now I’ve seen that we have the “Algolia Refresh a Simple Search” Action" which probably solves this. However, when I put that into my workflow, I get an error as can be seen in the screenshot below.
Has anyone experienced the same or the idea of a workaround?
Refreshing the page works but tbh, that kind of sucks because this slows down the entire search process and my whole point of using Algolia was that I wanted to have that near-instantaneous search experience.