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

Feature/areg-fts-sorting-fix - fix for - antibodies that do not appear in the unsorted results but appear in the sorted results #260

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

D-GopalKrishna
Copy link
Contributor

@D-GopalKrishna D-GopalKrishna commented Jul 5, 2024

Task description:
Problem - there are some antibodies that do not appear in the unsorted results but appear in the sorted results.
Reason - this happens due to - sorting annotation being the same for different antibodies. This leads to improper sorting and leads to inconsistent results for each page.

Solution - add another F("ix") to include as part of sorting. This will help us to keep the sorting different for every filtered_antibodies. We do so by replacing the sorting annotation with the following:

filtered_antibodies.annotate(
        ix_float=Cast("ix", FloatField()),
        sorting=F("ranking") - F("antibodysearch__defining_citation") / 1000 - F("antibodysearch__disc") * 100 +  F("ix_float") / 1000000
    ).order_by('-sorting')

@D-GopalKrishna D-GopalKrishna requested a review from filippomc July 5, 2024 22:10
@D-GopalKrishna D-GopalKrishna changed the title Feature/areg-fts-sorting-fix - Feature/areg-fts-sorting-fix - fix for - antibodies that do not appear in the unsorted results but appear in the sorted results Jul 6, 2024
@filippomc filippomc merged commit 65a9414 into develop Jul 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants