Set ranking rules at search time #593
Replies: 2 comments
-
Here's an example of what I think is a pretty common use case. I want to find Symfony bundles for working with APIs, so I set the search to "api" https://packages.survos.com/?q=api&marking=symfony_ok I'd like to look at the most widely-used ones first, so I sort by number of downloads. As I'm scrolling down, I suddenly see the number of downloads changes, which jumps out as a bug. But if you look at ranking, it's right. So while I could reset the index to be prioritize sorting, most of the time I don't want to -- it's a runtime setting, not an index build setting. I think this is really common -- sort by price, rating, time, combine with a full-text search. Please consider making it a run-time option, even if there is a cost associated with pagination. |
Beta Was this translation helpful? Give feedback.
-
Here's an example on a single page: https://packages.survos.com/?q=payment&marking=symfony_ok Sorting by downloads (by clicking on the title) looks like it's broken. |
Beta Was this translation helpful? Give feedback.
-
Summary
I would like to be able to set the ranking rules at search time, possibly with a new search parameter:
rankingRules
.null
), then the settings' ranking rules will be usedWhy
settingsUpdate
task could take a very long time if a lot of indexing tasks are already enqueued. Doing it via a search parameter, on the other hand, is instant and does not modify the index.rankingRules
would be a property of the tenant token, which would be enforced at search-time when it is used to authenticate the request)"Caveats
It could be dangerous to allow anyone to set arbitrary ranking rules due to performance (and therefore DoS) issues. This can be solved in two ways: (1) limit who can set custom ranking rules; or (2) make sure that searches stay quick no matter what ranking rules are used (my preferred solution)
Currently, one can add a custom ranking rule
my_field:asc
even ifmy_field
is neither filterable nor sortable. This would not be possible at search time.Beta Was this translation helpful? Give feedback.
All reactions