primer / doctocat

A Gatsby theme for building Primer documentation sites

Home Page:https://primer.style/doctocat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve search performance on larger sites

BinaryMuse opened this issue · comments

While #178 helped minimize page jank while searching, the actual search process on larger sites (particularly primer/css) still takes a while — sometimes 300-1000ms depending on the query. It seems that while Fuse.js has the fastest index time, it also has the slowest search time. This is probably more ideal for a search-and-refresh flow; for real-time fuzzy-searching, we should consider an alternative solution.

I experimented with using Lunr, and while searching was indeed faster, getting good fuzzy-searching results was more difficult, as it tends to behave more like a regular full-text search. I experimented with custom queries using Index#query and adding wildcards and edit distance markers, but this increased search times to multiple seconds. More experimentation is needed.

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.