PavlidisLab / GemBrow

The Gemma Browser
Apache License 2.0
4 stars 1 forks source link

table order isn't preserved when a query is present #112

Closed oganm closed 1 month ago

oganm commented 1 month ago

If query is filled, ordering by the columns of the table does not correctly sort the results

Lack of order image

Order image

arteymix commented 1 month ago

It's possible that the order is ignored in the backend because we sort results by full text score. I'll take a look!

arteymix commented 1 month ago

So yes, I just checked the code and this actually a bit more fancy: results are sorted first by FT score and then by whatever column you picked. I guess we can change that, but we need a way to sort by score by default. I think right now the frontend by -id by default.

arteymix commented 1 month ago

Fixed in https://github.com/PavlidisLab/Gemma/commit/9357bd8ee5b7438b4db29e72d80d47d04141973e.

New behavior: sort is now has two possible defaults: if a query is set, -searchResult.score otherwise it's +id.

You can explicitly sort by -searchResult.score and even +searchResult.score. However, for that to work, you must pass the query parameter.