pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Consider search index optimizations

Open jayhesselberth opened this issue 11 months ago • 0 comments

I recently went looking for the geom_boxplot docs on the ggplot2 site. Searching for geom_boxplot and hitting return took me to the top hit, a page on quantile regression unrelated to what I wanted.

Image

This is because geom_boxplot appears near the top of that page, higher than the first mention of geom_boxplot on the actual reference page.

My read of the fusejs docs suggest this could be easily addressed with some optimization of the parameters used to build the index. In particular, instead of setting ignoreLocation: true here, we could tune location, threshold, and distance index parameters. The docs provide a good example for this:

For example, consider the string "Fuse.js is a powerful, lightweight fuzzy-search library, with zero dependencies". Searching for the pattern "zero" would not match anything, even though it occurs in the string. The reason is that with the above defaults, for it to be considered a match it would have to be within 60 characters away from the expected location 0. However, "zero" appears at index 62.

jayhesselberth avatar Feb 02 '25 14:02 jayhesselberth