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

Weighted search #4

Open
jaimeiniesta opened this issue May 30, 2023 · 2 comments
Open

Weighted search #4

jaimeiniesta opened this issue May 30, 2023 · 2 comments

Comments

@jaimeiniesta
Copy link
Contributor

Hi, is there a way to define weights so that the most relevant fields give a higher score?

For example, if I have blog posts with title and body, a match on the title should be more relevant than one in the body.

@jaimeiniesta
Copy link
Contributor Author

Alternatively, we could also specify the fields to use in the search. This way, we can search only on title, and if no results, then search on body.

@philipbrown
Copy link
Member

Hey @jaimeiniesta!

Yeah, I want to add weighted search for one of my projects that use Haystack, so that should be coming soon.

Yeah, it should be possible to perform that search by building your own query and passing it to Query.run/2. I need to expand the documentation on how to do this, so I'll try doing this as an example.

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