-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue: SortBy at query time #730
Comments
Do really need to create multiple indexes? Right now, criteria are built at search time. The only place where we actually need a sorted document cache is for placeholder search, for which we need to cache sorted document_ids. What I am not completely sure about is how do we compose sorts. Should we allow sort by asc(foo) and desc(bar) for example? Should these case be specified in the |
I am thinking of a
|
So we would have to know in advance every possible sort filter combinations? |
yeah this seems necessary to perform efficient sorting... |
also if i'm not mistaken, we need a |
Okay, it's not ideal from a usage POV, but it's still usable. So it sounds like a good compromise. |
Is |
replacement, Algolia call them sorting strategies, and I think it makes more sense when you sort according to multiple criteria at the same time |
I think:
{
price_asc": [ typo, asc(price) ],
...
},
[price, ...] |
How do you specify the other rules in this case? |
Ah yes I get what you mean, but we can't support placeholder search if we do that |
When I read the @Kerollmops issue description:
I was not sure to really understand what you expected, so, I thought about an array of string with attributes names, but I was not sure at all 😅 |
No we don't we we do is adding a new setting where we list all of the attributes we use for the
Yeah, but the ranking rules are already known by the engine, therefore the ranked map have already been created for all of the criteria i.e.
I want to support combined sort startegies but @qdequele didn't thought it was useful.
@marin we have a ranked map by attribute that is used in any criterion, not a ranked map by criterion. Ranked maps doesn't know about the sort order i.e. |
@Kerollmops we also keep a sorted list of doctors for every attributes then for placeholder search |
How does that mix with existing ranking rules? |
@Kerollmops I think we can easily do multiple sorts during the search by declaring in settings the possible sortable attributes. And in the search query, write the complete sort operation to do. |
This is not possible with placeholder search |
do we have any news on issue? |
Hello @paligiannis! This is an actively requested feature by our users, we will start working on it for releases coming after 0.21. I can't give an exact date but I will push this feature for our next iterations. We still need to define how far we want to go with the sortBy. |
@gmourier thanks for the reply. I would be interested if I could help in research or anything, please let me know. |
Thanks @paligiannis! |
Any news on this matter? We have been looking in ways to order our data using multiple integer fields. |
Hello @ppamorim, @gmourier answered about this less than 2 weeks ago in this same issue 😉 #730 (comment) |
Filters : show document by true or false, example : product in stock = true , product has promo = false ; |
Closed in favor of a future tracking issue coming soon! :) |
It would have been nice to get the new issue link before closing this one. |
We don't have any tracking issue ready yet, but here is most of the work done by our PM on it https://github.com/meilisearch/product/issues/43 |
Here is the new one: #1581 |
Ok! I got it al wotking, the big problem was that when using docker, i assumed that
Would be the latest version... but i got an old one.. maybe it was my cache or something. I now typed the version, and its working. Thank you guys for your time and effort! |
When using docker you have to |
The
SortBy
feature is something that will help e-commerce websites or any website that needs to display documents in an order that depends on the user front-end settings, therefore at query time. This can be useful when you want the user to be able to choose if he want to see documents by ascending or descending price for example.For that we will add two settings:
sortableAttributes
field to the settings, this way the engine is aware of the fields that it needs to index like numbers, etc...sortBy
field to the search query parameters, it contains the name of one of the sortable attribute you defined in the settings and will be used as the last sorting criterion.How Algolia handles that
Algolia uses replicas to handle this kind of custom search, for each of the custom sortable attributes you want to have, the tools of Algolia creates replicas of your main index and changes the settings.
When a search query with custom sorting rules is performed, the front-end tools will request the right index. This index is named based on the rules you changed e.g. "movies_asc(price)_desc(released_at)".
Notice that you pay for all the replicas you have and all documents that are in any index count, it means if your plan allows you to have 10k documents but you have one replica, therefore you can only have 5k documents.
The text was updated successfully, but these errors were encountered: