bookdown search

Reading up on scoring theory used by fuse, this seems more like a feature(s). From the page https://fusejs.io/concepts/scoring-theory.html there are two possible culprits:

  • Field-length Norm: The shorter the field, the higher its relevance. If a pattern matches a short field (such as a title field) it is likely to be more relevant than the same pattern matched with a bigger field.
  • Distance, Threshold, and Location, text determine the number of words that are included in the search.

I tried if setting the search engine options to ignore the location and field norm, but that does not seem to work (or I am using this wrongly).

bookdown::bs4_book:
  css: bs4_style.css
  theme:
    primary: "#096B72"
  repo: https://github.com/rstudio/bookdown-demo
  config:
    search:
      engine: fuse
      options: 
        isCaseSensitive: false
        findAllMatches: true
        includeScore: false
        ignoreLocation: true
        ignoreFieldNorm: true
1 Like