Skip to content
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

Closed
rihadavid opened this issue Apr 14, 2019 · 7 comments
Closed

Full-text search ascending/descending bug (typo?) #5504

rihadavid opened this issue Apr 14, 2019 · 7 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed type:docs Only change in the docs or README

Comments

@rihadavid
Copy link
Contributor

rihadavid commented Apr 14, 2019

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

@dplewis
Copy link
Member

dplewis commented Apr 14, 2019

Nice catch! I use it but never really thought about it, it is descending

@dplewis dplewis added type:docs Only change in the docs or README good first issue labels Apr 18, 2019
@acinader
Copy link
Contributor

@rihadavid any interest in taking this on?

Steps I'd think we'd need:

  1. failing test to verify
  2. add deprecation notice to code and documentation

Ideally, we could find some 'new way' to do it right query.ascendingScore()/query.descendingScore()
is the terrible first thing that comes to mind, so we don't have to deal with any blast radius by actually breaking it.

In the future, we could then decide to no longer support '$score' passed in...

@rihadavid
Copy link
Contributor Author

@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 🙈

@iamvajid
Copy link

iamvajid commented May 6, 2020

@acinader - is this open ? Hunting good-first issues

@davimacedo
Copy link
Member

@iamvajid this one is still open. A PR will be very welcomed.

@iamvajid
Copy link

iamvajid commented May 7, 2020

Thanks @davimacedo , i will give it a try

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed and removed help wanted labels Nov 1, 2020
@dblythy dblythy closed this as completed Sep 15, 2021
@mtrezza
Copy link
Member

mtrezza commented Sep 16, 2021

Closing via #7496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed type:docs Only change in the docs or README
Projects
None yet
Development

No branches or pull requests

7 participants