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

Search input with enhanced server-side functionality #1699

Open
thohan88 opened this issue Sep 23, 2024 · 0 comments
Open

Search input with enhanced server-side functionality #1699

thohan88 opened this issue Sep 23, 2024 · 0 comments

Comments

@thohan88
Copy link

thohan88 commented Sep 23, 2024

Great to see all the activity in bringing shiny to python, really appreciate it!

In my work, I have often missed the opportunity to have a truly server-side search bar for users. While the current server option of input_selectize works well for medium-sized data, it involves a roundtrip to Python/R, which can be memory-intensive for larger datasets at best. Typical use cases for an improved search includes:

  • Making an API-call to an external service (e.g. retrieving legal entities from a public register based on search query )
  • Making a database call to retrieve search results (e.g. retrieve ID of sales orders based on search query)

Currently, these cases do not fit well into the server-side capabilities of update_selectize.

I've made a modified version (update_search) that accepts a custom search function, which can take additional arguments such as a database connection or request object. Below is a minimal shinylive example of filtering a dataset of cities using DuckDB as the back-end.

I think the the combination of a low memory server-side function and custom rendering options from selectize makes this a compelling option for search. Is there interest in bringing something like this to shiny core?

Happy to move this into a discussion if it is more appropriate.

search-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant