Skip to content
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

feat: debounced search #60

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

Ku3mi41
Copy link
Contributor

@Ku3mi41 Ku3mi41 commented Apr 16, 2024

Debounced searchbox on search page. Implementation taken from algolia site.

Now typing «redis» only one search will be performed instead of five in a row.

@bfritscher
Copy link
Owner

Cool, will test not sure about the default value of 400. Might depend on collections sizes, on smaller collections lag might not be that great an issue.

@Ku3mi41
Copy link
Contributor Author

Ku3mi41 commented Apr 16, 2024

This is the delay between keypress events. Imagine that I search for “transport”. Now we have this behavior:
image
Here the process takes more than 2 seconds in total, but single search in Typesense took about 60ms.
New behavior:
image
0.3s (ping to server about 90) after (yes + 0.4 s) I stopped typing. It feels smoother than the laggy UI with 9 instant searches.
I don’t argue, perhaps the delay proposed by Algolia of 200ms is more suitable, I just don’t type that fast :)

200 + 50ms (average server response) will be less than 300 which is a good UX threshold
@bfritscher bfritscher merged commit b244ace into bfritscher:main Apr 24, 2024
1 check passed
@Ku3mi41 Ku3mi41 deleted the feature/debounced-search branch May 3, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants