haystack
haystack copied to clipboard
Weighted search
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.
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
.
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.