A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
As planned in #4682, this PR updates the cl_send_alerts command to support V2 of the Opinion Search Alerts Webhooks.
The following changes have been applied:
All Opinion Search Alerts emails now use the new email format, which displays nested opinions within the Opinion Cluster. This is achieved doing an ES parent-child query all the time as main query.
If the user has a V1 Webhook enabled, an additional query is performed to retrieve plain results for the alert. This is executed via the MultiSearch API, allowing both the parent-child query and the plain query to be requested in a single request.
Nested results from the main query are used to render the email and V2 Webhook.
Plain results are used to send V1 Webhooks.
It's important to note that V1 Webhooks use a collapse query to group Opinions belonging to the same cluster. This aligns with V3 of the Opinions Search API running on ES, meaning that the same ES V3 API backwards incompatible changes for opinions apply to V1 Webhooks.
These changes will take effect once we switch to ES for Opinions. Until that happens, we will continue sending only V1 Webhooks using Solr and the regular plain email, even if users have enabled a V2 Webhook endpoint for Search Alerts.
Refactored the code used to merge child documents in nested queries to eliminate duplicate and redundant code across the codebase.
Updated the Opinion Search Alerts tests accordingly.
Below are examples of the updated Opinion Search Alert Email and Webhooks:
*****************
CourtListener.com
*****************
-------------------------------------------------------
We have news regarding your alerts at CourtListener.com
-------------------------------------------------------
Your daily opinion alert -- Test Alert O Disabled -- had 1 hit:
-------------------------------------------------------
View Full Results / Edit this Alert: https://www.courtlistener.com/?type=o&stat_Unpublished=on&order_by=score+desc&filed_after=2024-11-14&edit_alert=23
Disable this Alert (one click): https://www.courtlistener.com/alert/disable/vAFtMQ10lUvXLwCqCqhxzTm4EBcWDDsTJFHinvyS/
1. California vs Lorem (Bankr. C.D. Cal. 2024)
Lead Opinion
...Lorem dolor sit amet, consectetur adipiscing elit hearing....
Combined Opinion
...Lorem dolor california sit amet, consectetur adipiscing elit....
- Download original from the court: https://ca.flcourts.gov/
- Download the original from our backup: https://storage.courtlistener.com/test/search/opinion_html.html
~~~~~
- View this item on our site: https://www.courtlistener.com/opinion/11/california-vs-lorem/
************************
This alert brought to you by the 501(c)(3) non-profit Free Law Project
- Blog: https://free.law
- BlueSky: https://bsky.app/profile/free.law
- X: https://x.com/freelawproject
- Donate: https://donate.free.law/forms/supportflp
- Become a Member: https://donate.free.law/forms/membership
Please donate to support our work.
Process notes (@flooie and @s-taube, you might want to perk your ears, so we're all on the same page):
I assigned to Eduardo so it shows up in his "By Assignee" tab.
I set Eduardo as the reviewer, because he is.
I moved it to the To Do column so it shows up in Eduardo's todo column.
@ERosendo, when you finish your review, see if you can assign this back to Alberto, so it shows up in his queue, and then back and forth until you're done.
I think this should work, but I'm still experimenting. Definitely curious what we think.
As planned in #4682, this PR updates the
cl_send_alerts
command to support V2 of the Opinion Search Alerts Webhooks.The following changes have been applied:
Below are examples of the updated Opinion Search Alert Email and Webhooks:
Webhook V1
Webhook V2
Let me know what do you think.