User-defined position for search results (Pinning documents) #323
Replies: 2 comments 1 reply
-
@gmourier Thanks for creating a discussion. :)
Yep. It's really helpful on cases that aren't directly indexed, like user feeds (e.g. favorites, history, etc.), showing items at random or indeed 'pinning' results. This is my workaround for now:
You may ask why not directly use DB queries (incl. filtering)? Well, they are slow, inflexible (not every attribute is listed in the DB), lack features ( Another workaround may be creating multiple indexes, like |
Beta Was this translation helpful? Give feedback.
-
Hey there 👋 We published a workaround guide for Displaying promoted search results on our blog. We hope it's useful, feedback is welcome! Note: The tutorial uses React, we're thinking about writing another tutorial explaining how to implement this workaround on the server side. Let us know if you're interested! August 10th update: We added a second tutorial to implement on the server side,How to implement document boosting with a second index |
Beta Was this translation helpful? Give feedback.
-
Following a discussion initiated here https://github.com/meilisearch/product/issues/43#issuecomment-982801719 by @francoism90.
I'm using something like this:
When no sort is giving, I expect item 20 first, 10 second and 30 third. However, the results still seems to be based on relevance.
I'm I missing something here? I cannot do
sort => id:asc
because this would result in: 10, 20, 30 ..Thanks.
In this particular case, it seems to me that MeiliSearch returns the default order of the documents in the database. I am not an expert on Laravel Scout but it seems impossible to me in the current state unless a sorting on the client-side is done, I doubt it.
The sort can only be ascending or descending and is triggered after or before the tie-breaking of other ranking rules, it depends on the position of the sort ranking rule among them. For a placeholder search (aka without any term) entered by the end-user, MeiliSearch will not be able to define an order other than strict ascending or descending since no other ranking rules will be triggered to mitigate the position by relevancy.
It reminds me strongly of being able to pin results in a precise order no matter what the rankings rules return. It would be a kind of bypass. It would also be very useful in an e-commerce use case.
Beta Was this translation helpful? Give feedback.
All reactions