Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't search for exact matches #22

Open
anjackson opened this issue Oct 2, 2024 · 0 comments
Open

Can't search for exact matches #22

anjackson opened this issue Oct 2, 2024 · 0 comments

Comments

@anjackson
Copy link
Contributor

Feedback from the iPRES 2024 workshop:

Searching for "digital advertising" (no matter if quoted or not) yields many results that match "digital" or "advertising" or even "advertise", which is cool. But is it possible (without resorting to the database view) to focus on results that contain the exact string "digital advertising"?

The Just-The-Docs search feature is unfortunately quite aggressive. It uses lunr.js and hard-codes the configure such that:

  • "Phrase search" is not supported (because it's not part of the lunr.js syntax).
  • Forces all supplied keywords have a trailing wildcard matcher. i.e. searching for data will search for data*.
  • If this doesn't match anything, the code switches to finding matches within a fairly large edit-distance of the original terms. Note that there does not appear to be any stemming step, just this edit distance trick.

Documenting the search behaviour was already a known gap, but this behaviour is too 'clever' by half and seems to confuse people. For the future, it may be better to move away from JTD and this setup, and like the Start2Preserve Learning Resources site, use a basic Bootstrap theme and add in https://pagefind.app/ with appropriate configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant