WebDevStudios / wp-search-with-algolia

Improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.
https://wordpress.org/plugins/wp-search-with-algolia/
141 stars 54 forks source link

How to add debouncing to the plugin? #380

Closed unitedus-emil closed 11 months ago

unitedus-emil commented 11 months ago

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 (https://github.com/algolia/autocomplete/issues/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!

tw2113 commented 11 months ago

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

tw2113 commented 11 months ago

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/