Rank documents with more matches higher than those with fewer #777
Replies: 1 comment 2 replies
-
Hello @LukasKalbertodt,
If I get your intent, you want to favor documents that globally speak about a specific subject related to the query over the documents containing a reference or a quote but don't focus on the subject. |
Beta Was this translation helpful? Give feedback.
-
I am building a service that searches through videos. Captions/subtitles of the video are also in the index and searchable. That makes it possible for users to find videos where some word is said at some point, even if it's not mentioned in the metadata (like the description or title). Captions are usually quite a bit more text than title, description and other metadata.
I noticed that videos that contain the query term many many times in the captions are sometimes ranked below videos that only mention it once. Intuitively, a video where the query term is spoken all the time is a lot more relevant than one where it is only mentioned once.
I read the ranking rules documentation again and conducted some tests and yes, it seems to me that Meili does not consider the number of matches at all during ranking. Consider these two documents:
Searching for
banana
results in:"Foo" has a higher score since the query term appears earlier in the attribute. But for "Bar", almost every second word is "banana", so I would expect that to be sorted higher.
curl commands to reproduce the above test
So I wonder: why is this? I'm sure this was considered at some point?
Unfortunately, I don't see a way to configure Meili to consider the number of matches. None of the built-in ranking rules seem to care about it (so reordering them changes nothing), and the custom ranking rules are just "sort by attribute" as far as I can see.
What's the best thing I can do in this situation?
Beta Was this translation helpful? Give feedback.
All reactions