-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When typing quickly, can ignore the previous useless request? #153
Comments
I have an idea that I don't know if it can be realized, as follows: var timeout
function oninput(s) {
timeout && clearTimeout(timeout)
timeout = setTimeout(() => {
doquery(s)
}, 500)
}
function doquery(s) {
console.log(s)
}
oninput('ha')
oninput('hai')
oninput('hains')
setTimeout(() => {
oninput('hains point')
}, 1000) output:
It can be seen that when typing quickly, only the real requirements: |
We do debounce search queries, see meilisearch-docsearch/src/DocSearchModal.tsx Lines 203 to 227 in 97cb6a2
it is 100ms though, not 500ms |
Cool, maybe 100ms is too short. |
I will probably make this configurable instead. |
Great, but I think 100ms is indeed too low, 500ms will be better, it seems that there is no need to change it to configurable, because everyone's needs are not much different. |
from my previous testing, 500ms was a bit slow and noticeable specially when selecting some text on page then hitting the search hotkey. |
Hmm, you need to decide the specific data. this time should be greater than the speed of normal people typing two letters. |
加油老哥 |
太秀了,神速 |
When typing quickly, can ignore the previous useless request?
eg. I search for
hains
, and will search forha
,hai
, andhains
respectively.The text was updated successfully, but these errors were encountered: