-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add sorting by case number and by advisory opinions number in legal/search #5246
Conversation
878009d
to
01b5bf8
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5246 +/- ##
===========================================
- Coverage 85.80% 85.72% -0.09%
===========================================
Files 81 81
Lines 8144 8153 +9
===========================================
+ Hits 6988 6989 +1
- Misses 1156 1164 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@JonellaCulmer @patphongs After @fec-jli changes get merged to API, archived murs appear first in the MUR search page and not current murs. Just checking with you if this is what we want to show on MUR search page. Current Prod without sorting: Dev with @fec-jli changes: |
01b5bf8
to
2802690
Compare
2802690
to
ec23765
Compare
add column case_serial in current_case add an_no,ao_year,ao_serial in advisory_opinions add sort by ao_no in advisory_opinions
ec23765
to
9d85603
Compare
FROM MUR_ARCH.ARCHIVED_MURS | ||
ORDER BY mur_id | ||
ORDER BY mur_id desc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fec-jli Just like cases and ao, should you also order by case_serial for archived murs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review.
It is better sort by column itself not alias name.
case_serial is the alias name of mur_id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really impressive work. Really tough and a great solution, thank you @fec-jli!
Summary (required)
This PR will add sorting by
case_no
(MUR/AF/ADR) number. The default setting is descending.This PR also add sorting by
ao_no
(advisory opinions) number. The default setting is descending.Action item(s):
case_serial
column in three cases (MUR/AF/ADR) return, load to ESao_no
,ao_serial
,ao_year
columns in three cases advisory opinions return, load to ESSome cf task commands when reload to ES:
Required reviewers
1-2 devs
Impacted areas of the application
legal/search resource
How to test
Local or deploy on dev.
==Local
Follow wiki to setup local Elasticsearch
Some basic commands:
python cli.py display_index_alias
python cli.py delete_index docs
python cli.py create_index
python cli.py delete_index archived_murs
python cli.py create_index archived_murs
upload sample data
upload current murs:
python cli.py load_current_murs 7212
python cli.py load_current_murs 4633
python cli.py load_current_murs 2314
python cli.py load_current_murs 3620
python cli.py load_current_murs 3774
python cli.py load_current_murs 3987
python cli.py load_current_murs 2804R
upload archived murs:
python cli.py load_archived_murs 101
python cli.py load_archived_murs 103
python cli.py load_archived_murs 179
python cli.py load_archived_murs 9
python cli.py load_archived_murs 99
upload admin_fines:
python cli.py load_admin_fines 3726
python cli.py load_admin_fines 3571
python cli.py load_admin_fines 3314
upload advisory opinions : (from 2022-08 to 2022-25)
python cli.py load_advisory_opinions 2022-08
1)murs: descending
http://127.0.0.1:5000/v1/legal/search/?type=murs
http://127.0.0.1:5000/v1/legal/search/?type=murs&sort=-case_no
2)murs: ascending
http://127.0.0.1:5000/v1/legal/search/?type=murs&sort=case_no
3)admin fine: descending
http://127.0.0.1:5000/v1/legal/search/?type=admin_fines
http://127.0.0.1:5000/v1/legal/search/?type=admin_fines&sort=-case_no
4)admin fine: ascending
http://127.0.0.1:5000/v1/legal/search/?type=admin_fines&sort=case_no
5)adr: descending
http://127.0.0.1:5000/v1/legal/search/?type=adrs
http://127.0.0.1:5000/v1/legal/search/?type=adrs&sort=-case_no
6)adr: ascending
http://127.0.0.1:5000/v1/legal/search/?type=murs&sort=case_no
7)advisory opinion descending
http://127.0.0.1:5000/v1/legal/search/?type=advisory_opinions
http://127.0.0.1:5000/v1/legal/search/?type=advisory_opinions&sort=-ao_no
8)advisory opinion ascending
http://127.0.0.1:5000/v1/legal/search/?type=advisory_opinions&sort=ao_no
-deploy branch and test urls on dev
1)murs: descending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=murs
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=murs&sort=-case_no
2)murs: ascending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=murs&sort=case_no
3)admin fine: descending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=admin_fines
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=admin_fines&sort=-case_no
4)admin fine: ascending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=admin_fines&sort=case_no
5)adr: descending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=adrs
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=adrs&sort=-case_no
6)adr: ascending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=adrs&sort=case_no
7)advisory opinion: descending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=advisory_opinions
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=advisory_opinions&sort=-ao_no
8)advisory opinion: ascending
https://fec-dev-api.app.cloud.gov/v1/legal/search/?type=advisory_opinions&sort=ao_no