Consider search index optimizations

Open
#2,849 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, r

Research direction

Start with inst/BS5/assets/pkgdown.js at lines 96–102 and read the linked Fuse.js index-parameter documentation. Reproduce the geom_boxplot search on the generated ggplot2 documentation, then evaluate location, threshold, and distance settings. Done means the relevant reference page ranks above unrelated pages for this query without breaking general search behavior.

Written by the indexing model from the issue text.

Description

search :mag:

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.

Dominant language
R
Stars
775
Forks
355
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/pkgdown

All issues in r-lib/pkgdown

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.