question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Search Relevance Tweaks

See original GitHub issue

Search Terms

Search, Relevance, Lunr

Problem

My colleagues and I have spent the last few weeks rigging up TypeDoc on our TypeScript library. For the most part it works beautifully and we’re astonished how well this project works out of the box, but we’ve been having some trouble with a few quirks in the search feature:

  • exact matches don’t seem to get a boost in relevance. We have a class called “Button”, but when we search for “button”, the main result we’re interested in gets muscled down to the 53rd slot by other minor results that have “button” in their name (eg. “Foo.primaryButton”),
  • there’s no way to adjust the number of search results, and no “View all” option
  • classes don’t seem to get a boost over props and other minor features
  • there’s no way to boost on things like categories

I understand that not everyone wants search to work the same way, so I thought this might be a good candidate for a plugin, but once I looked into it I realized that plugins seem to have more to do with reflection than runtime adjustments like this.

So, before we dive in and start preparing a PR, I thought I’d see if you folks can provide any insight or background.

Suggested Solution

Off the top of my head, I would like to see some kind of search configuration on typedoc.json. Maybe something like this:

{
  ...
  "search": {
    "maxResults": 10,
    "weights": {
     "isClass": 1.1,
     "exactMatch": 2.1,
     "byCategory": {
        "component": 3.4,
        "coreComponent": 4
      }
    }
  }
}

Thoughts?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Gerrit0commented, Jun 25, 2022

The defaultValue is the way to go I think, with the default boosts documented on the website. gzip ought to take care of the extra bloat, so I don’t think that’s much of an issue

0reactions
Gerrit0commented, Aug 6, 2022

Going to go ahead and close this, PR welcome if you (or anyone) would like to propose some defaults, but just having exact matches boosted does pretty well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 1. The search relevance problem - liveBook · Manning
Search relevance is such a hard problem in part because we take the act of searching for granted. Search applications take a user's...
Read more >
How to Optimize Search Relevance: Boosting and Filtering
Utilizing boosts and filters to prioritize your search results based on what is being searched for by your users improves search relevancy.
Read more >
14 Quick SEO Tweaks to Increase Search Visibility - seoClarity
Boost your search engine visibility with these 14 SEO tweaks that can support your content's chances at being seen in organic search.
Read more >
7 Ways To Tweak Your Content For Better SEO
7 Ways To Tweak Your Content For Better SEO · 1. Ensure Great Content And Structure · 2. Show Your Layout Some Love...
Read more >
Relevance Tuning - Architecture - SearchBlox
Relevancy Tuning in Search Relevance Tuning templates let you adjust relevance based on type of content or metadata using pre-made tuning templates OR ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found