New ranking rule: words in [attribute set]
#595
Closed
loiclec
started this conversation in
Feedback & Feature Proposal
Replies: 3 comments
-
Thanks @loiclec 👍 I'm cross-referencing a previous product discussion (#107) where the need may be solved by this proposal if (#593) is implemented. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It sounds like a must have feature! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey folks 👋 v1.3 has been released! 🦁 You can now define fields to search on at search time ✨ Note: Attributes passed to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We could add a new ranking rule that would sort documents by the number of words contained in a subset of the searchable attributes.
For example, let's say we have the following searchable attributes:
If someone has the ranking rules:
then the documents will be sorted first by the number of words contained in all the searchable attributes, without preference for any attribute in particular.
The new ranking rule
words in [attribute set]
would work similarly, except that it would be constrained to a subset of the searchable attributes. So one could have the ranking rules:and the documents will be sorted:
title
andauthor
description
To illustrate how this differs from the behaviour of
words
, let's consider the following dataset:And the search query:
Using the first set of ranking rules, the second document would be returned first because it contains all the search query terms, while the first document would be returned later because it misses the term
film
.Using the second set of ranking rules, the first document will be returned at the top because it contains the most query words in the attributes
[title, director]
.Additionally, we could consider giving a weight to each attribute passed as parameter to the
words in
ranking rule, like so:Such that a query word found in the attribute
title
would be worth 2 words inreview
.Note that a weighted
words in
ranking rule would be very similar to the ranking ruleattribute
(ignoring the word positions within each attribute) and an unweightedwords in [all searchable attributes]
ranking rule would be equivalent to the currentwords
ranking rule.Beta Was this translation helpful? Give feedback.
All reactions