-
Notifications
You must be signed in to change notification settings - Fork 340
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
Handle sorting (Meilisearch) #537
Conversation
Handle sorting.
Thanks for your pull request to Laravel! Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include. If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions! If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response. |
It doesn't make sense. It is not a new functionality but it is an implementation already existed method added in accepted PR #123 |
@mgralikowski @taylorotwell we are also facing this issue. ordering doesn't work out of the box with meilisearch when using scout. |
Would it be possible to still merge this? |
Another reason to add sorting: If you search resources by text, you are not able to sort them anymore for example by date. |
@taylorotwell come on. It does not add any complexity, it is just a one, protected method... There is a whole article about sorting: |
this PR will have zero effect on Laravel Nova, the original limitation still persists. |
The issue with Nova is exactly what my PR resolves - a combination of full-text searching/filtering with sorting at the same moment. In the Nova, we want to find rows by phrase and in the second step - sort them by date - for example. I have not analyzed the code base of Nova, so I am sure it will not resolve the issue automatically, this is only the first step and basically for Meilisearch only. |
Sorting in the meilisearch is for a long time and works very good so there is no reason to not implement this functionality.
https://docs.meilisearch.com/reference/features/search_parameters.html#sort
By this query, we sort results first by date (newest) and next by price (cheapest). Sorting works like in MySQL.