-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Full-text search ascending/descending bug (typo?) #5504
Comments
Nice catch! I use it but never really thought about it, it is descending |
@rihadavid any interest in taking this on? Steps I'd think we'd need:
Ideally, we could find some 'new way' to do it right In the future, we could then decide to no longer support '$score' passed in... |
@acinader thanks for the suggestions, unfortunately, reporting bugs is the best I can do at the moment, working 12 hours a day on my startup 🙈 |
@acinader - is this open ? Hunting good-first issues |
@iamvajid this one is still open. A PR will be very welcomed. |
Thanks @davimacedo , i will give it a try |
Closing via #7496 |
I have just discovered that when I want to use a full-text search with ordering, only
query.ascending('$score')
is working.query.descending('$score')
throws"Invalid field name: $score."
.When you are doing a full-text search, you obviously want the results with a higher score first, so it should be
descending
. But here's the thing - it actually returns the results in descending order.It seems to be only a wording bug, but fixing it might be tricky because developers who are already using the
query.ascending('$score')
for getting the descending results will not expect the change in future version.Maybe the safest 'fix' would be to add a warning note to the docs that this wording mistake has been made and ignore it. Nobody will probably ever need (actually) ascending results anyway 😄
Tested on 2.8.4, 3.1.3, 3.2.3 in cloud code function
The text was updated successfully, but these errors were encountered: