Delay in server side search query
Delay in server side search query
jokohews
Posts: 7Questions: 2Answers: 0
Is it possible to wait for the user to stop typing in the search bar before sending the query to the server side api?
It seems to hit the server every key stroke. Any way to add a second or 2 delay before posting?
Thanks,
Jay
This discussion has been closed.
Answers
The
searchDelay
option is the builtin way to delay the searches. If this isn't what you want there are some threads on this forum that discuss other techniques to delay the server side search request, such as using your one input that uses achange
event instead ofkeyup
or I think there is a debounce solution someone posted. Take a look for those if interested.Kevin
Thanks for the quick reply.
The searchDelay option looks right... it doesn't seem to have any effect. I set it to 10s to exagerate the delay and the search fires immediately.. it sends a new api post for every character. I've added like this..
Any thoughts?
it looks like it's taking effect.. thanks
It's difficult to tell.. is the delay sliding? if a key stroke happens before the delay time, does it extend the delay?