InfoCommons / cic

Apache License 2.0
0 stars 0 forks source link

Autocomplete for name search filters #171

Closed ryscher closed 1 year ago

ryscher commented 2 years ago

When a name is typed in the search filter for Awardee, PI Name, or Program Official, update the autocomplete list to show all matching names in the database, not just matches among the 20 that were initially in the facet list.

This functionality currently exists in the existing CIC site:

Screen Shot 2022-06-22 at 12 56 34 PM
sg3847 commented 2 years ago

@ryscher If we want auto-complete to work for any existing Awardee, PI Name, or Program Official, we will need to get all that information when page loads. I'd mentioned this before, that doing so will impact the page performance as we will be loading much more data on initial load than just 20 X 3 names. Also, does this mean that #157 doesn't apply anymore?

ryscher commented 2 years ago

We won't be able to load all possible values on page load; there will be too many. Instead, we want to dynamically query and re-load the autocomplete suggestions as the user types.

I know this is possible. I've done it in raw JS before, just not in React. But there are some suggestions here:

157 is related to this, but it's not exactly the same issue.

If this is difficult, I will disable the autocomplete suggestions for these fields until we have a more permanent solution.

ryscher commented 2 years ago

Sunaina was able to give us a workaround by increasing the facet size. This is great for the launch, but we will probably need a more scalable solution as the size of the content increases.

I'll move this to "done" until it becomes an issue again.