WebDevStudios / wp-search-with-algolia

Improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.

Home Page:https://wordpress.org/plugins/wp-search-with-algolia/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add debouncing to the plugin?

unitedus-emil opened this issue · comments

Is it planned to add support for debouncing Algolia sources into the plugin?
If not would it be possible for someone to explain how that might be achieved for users using a custom autocomplete.php template? I understand from the Algolia docs and some discussion on the autocomplete.js github (algolia/autocomplete#50) that I need to adjust sources but I'm struggling to see how I can adapt that to work in the template. We are a paid customer of the plugin, any help greatly appreciated!

I know there's a debounce property as per the current version of Autocomplete we still have for out of box https://github.com/algolia/autocomplete/tree/v0.38.0#datasets

However, I'm not sure how exactly to implement debouncing, truth be told.

Based on a found codesandbox at https://codesandbox.io/s/l9wrmkyzmq?file=/index.js:227-242, it may be as simple as just setting a value in milliseconds.

Template customization information can be found at https://github.com/WebDevStudios/wp-search-with-algolia/wiki

Closing as a non issue for the moment based on my reasoning here:

Given that real time is largely how Algolia has intended autocomplete and suggestions to be displayed, I have a feeling that we’re probably not going to switch this for out of box.

As per a reply found at https://wordpress.org/support/topic/use-debounce-please/