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

Order results by relevance #5

Open
oscarotero opened this issue Jan 31, 2022 · 2 comments
Open

Order results by relevance #5

oscarotero opened this issue Jan 31, 2022 · 2 comments

Comments

@oscarotero
Copy link
Contributor

Hi.
Is it possible to order the results by relevance? For instance, right now when I search markdown I have the following result:
image

The first results are pages from "Getting started" or other pages with the word "markdown" in the content. And the page of the markdown plugin is way down in the results list. I think a page having this word in the title should be more relevant than a page with this word in the content. So I'd like to propose a way rank the results by relevance. For example:

  • If the term is in the title, it has 1.
  • If the term in in the main description, it has 0.5.
  • If the term is in a paragraph, it has 0.2.

This allows to order the page by rank and opens the door to implement in the future more advanced ranking features, like define different weights for different properties, or if the word is repeat, or is at the begining of the content, etc.

@dragonwocky
Copy link
Owner

For performance, result ordering is done during the indexing process at the moment and sorted according to the site's sitemap/category. This would be useful but again part of a bigger update that would move away from the highly specialised component psyche is at the moment and into a more flexible/fuller search engine, I'll have a go at it during the holidays.

@oscarotero
Copy link
Contributor Author

Ok, thanks!
For inspiration, take a look to Fuse (https://fusejs.io), a great library that provides powerfull search support.

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

2 participants