Closed cuducos closed 6 years ago
I really didn't noticed that, but now let's test this PR:
Clone the repository:
$ git clone git@github.com:datasciencebr/jarbas.git
Open the repo folder:
$ cd jarbas
Checkout to @cuducos branch:
$ git checkout -b cuducos-fix-ordering origin/cuducos-fix-ordering
Update the branch:
$ git merge master
Copy the .env
file:
$ cp contrib/.env.sample env
Build and start services:
$ docker-compose up -d
Create the database and apply the migrations:
$ docker-compose run --rm django python manage.py migrate
$ docker-compose run --rm django python manage.py searchvector
Seeding it with sample data:
$ docker-compose run --rm django python manage.py reimbursements /mnt/data/reimbursements_sample.xz
$ docker-compose run --rm django python manage.py companies /mnt/data/companies_sample.xz
$ docker-compose run --rm django python manage.py suspicions /mnt/data/suspicions_sample.xz
$ docker-compose run --rm django python manage.py tweets
localhost:8000/dashboard
:8.1. Search for some text using the search bar (papel):
8.2. Try to filter by some clickable column headers (papel e ano 2009):
I think that's it, it is working combined! 🎉 Thanks @cuducos !
What is the purpose of this Pull Request?
In Jarbas Dashboard users could click in the table headers to try to sort the results by value, date, etc…
Unfortunately this user selected ordering was being overridden by the search vector rank.
Fortunately this PR fixes this bug ; )
What was done to achieve this purpose?
Before calling the
.order_by('-rank')
into the Django QuerySet Jarbas will check if is there any previous ordering in place.How to test if it really works?
/dashboard
)Who can help reviewing it? @anaschwendler