EnquistLab / TNRSweb

TNRS UI
http://tnrs.biendata.org
MIT License
0 stars 1 forks source link

Sort order of "All matches" download is incorrect when option "Sort by Higher Taxonomy" in effect #114

Closed ojalaquellueva closed 3 months ago

ojalaquellueva commented 7 months ago

When TNRS results are downloaded using option "All matches", alternative matches to the same submitted name should be grouped together (this can be achieved by sorting by ascending ID) and then sorted within a submitted name by ascending Overall_score_order (if Best Match option "Sort by Overall Score" is in effect) or by ascending Highertaxa_score_order (if option "Sort by Higher Taxonomy" is in effect). Currently, this is not occurring; alternative matches to the same name are often interspersed with matches to other submitted names.

ojalaquellueva commented 7 months ago

To replicate, submit the following names:

Helotiaceae Diplothrix juniperifolia Campyliaceae Warnstorfia trichophylla (Warnst. ) Tuom. & T. J. Kop.

Resolve using default settings. Lower match threshold to 0 and chose "Yes". Select best match option "Sort by Higher Taxonomy" and chose "Yes". Now download the names, making sure that option "All matches" is checked. Note the incorrect sort order. Also note that Best_match_overall_score is also incorrect (Best_match_highertaxa, however, is correct).

ojalaquellueva commented 5 months ago

Related to issue #113. Fix is probably the same or similar.

ojalaquellueva commented 5 months ago

Sorting rules:

  1. When BEST MATCH SETTING "Sort by Overall Score" is selected, sort the download of "All matches" as follows:

    ORDER BY "ID" ASC, "Overall_score_order" ASC

  2. When BEST MATCH SETTING "Sort by Higher Taxonomy" is selected, sort the download of "All matches" as follows:

    ORDER BY "ID" ASC, "Highertaxa_score_order" ASC

ojalaquellueva commented 5 months ago

Note that related issue #113 is now completed and closed. Just need to implement the same sort orders for the download.