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

Search: match counter #1025

Open
yndajas opened this issue Nov 25, 2022 · 1 comment
Open

Search: match counter #1025

yndajas opened this issue Nov 25, 2022 · 1 comment

Comments

@yndajas
Copy link
Member

yndajas commented Nov 25, 2022

Original search PR: #984

Background

[mostly copied from the original search PR]

Midway through development, we had a matches counter. Unfortunately the search engine we used (Elasticlunr.js) doesn't tell you how many matches it found for the search query (or constituent terms), only a score based on a "very perfect scoring mechanism". So we made our own implementation, counting the matches for the entire search query and displaying it under the heading (alongside breadcrumbs at the time)

However, this didn't account for matches in the title, nor for matches of each of the individual search terms when there were multiple. It should be possible to extend the functionality to achieve this, similar to how the match highlighting has been extended, however the results may still be confusing. The "very perfect scoring mechanism" means that the results are not ordered by a simple count, but some more sophisticated measure of relevance. This means that there might be a result that's higher up than a result with a greater number of matches

In the end, we removed the counter, but it's one to think about

For consideration

Could we do something with the Elasticlunr.js score, or should we implement a more complex (than the one used mid-development) counter of our own, looking at all matches for all terms within the search query, both within the content and the page title?

@lookupdaily
Copy link
Contributor

In addition to a match counter, I wonder if a 'missing: ' would be useful under each result? I use this quite often on google search to decide whether a link is useful. For example see the screenshot attached from Beautiful Canoe docs, which has both this info and a match counter.
Screenshot 2023-02-06 at 17 42 31

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

No branches or pull requests

2 participants