Add debouncing to the suggestions field
- pridigitalParticipant10 months, 2 weeks ago #37272
Hello,
I’ve set up a suggestion box for the selector #my-suggestions, using the “Suggest Content” query along with the “WPSolr – Fancy” template. It’s functional, but it currently sends a new AJAX request for each keystroke in the input field. I’m curious if there’s a way to implement “debouncing” for this field.
I believe incorporating debounce would be a valuable enhancement, following best practices, and would make a great addition to your plugin.
For reference, you can google “debounce javascript” to see how such a functionality can work.
Thank you!
wpsolrKeymaster10 months, 2 weeks ago #37274Thanks for the feedback.
Will be added to the release 23.6
pridigitalParticipant10 months, 2 weeks ago #37369Is there a way you could give us early access to this feature? Our live website is crashing because of this. Thanks!
wpsolrKeymaster10 months, 1 week ago #37372As a workaround, you can try to update your file wpsolr-pro/wpsolr/core/js/autocomplete_solr.js, to add more parameters to the js library’s constructor
$(this).devbridgeAutocomplete({...);
(line 478)For instance, from jQuery-Autocomplete documentation:
minChars: 3
deferRequestBy: 100On next release, we’ll add a textarea in the suggestions settings to set your own JSON options.
wpsolrKeymaster8 months, 1 week ago #38495WPSOLR 23.7 is ready.
You must be logged in to reply to this topic.