TypeStrong/typedoc-default-themes

Search takes too long for big index files

15202-sidorov opened this issue · 4 comments

I have a rather big index file (around 23.5 MB) and when I try to make a simple search, it takes too long to load any results. Sometimes the page is stuck completely for a minute and sometimes it can take 10 seconds to complete the search. Is there a way to descrease the search time for such a big index file? It is definatly not a networking issue, such thing happens when the index file is completely loaded.

The default themes don't load the search index until you click in the search box - so I suspect that network latency might still be (part of) the problem here. I always thought this was a strange design choice, but haven't gotten around to figuring out why and making it load earlier.

As for improving the search algorithm - we use lunr for that... there might be some settings that I'm not aware of.

Since we don't really need a fuzzy search, we have been able to remove it and it really improved the perfomance too. Is there any way that we can make the fuzzy search optional? I've been thinking about adding a config file in assets near the search.json and describing options in there. @Gerrit0 Can you suggest something?

I am open to pretty much any changes to how search works. I'd like for the behavior to be consistent across all typedoc generated docs, so I think it might be better to completely drop fuzzy searching. For smaller projects, it doesn't really matter... and if it is causing performance issues with large projects, I'm fine with turning it off.

I don't have a large enough project to really experiment with this myself... TypeDoc's generated docs are way smaller than what you are having issues with. Is your project open source?

No, unfortunatly our project is not open source.