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

Make party fields in the docket search results to maintain order consistency #4531

Open
albertisfu opened this issue Oct 3, 2024 · 2 comments
Labels

Comments

@albertisfu
Copy link
Contributor

In the following query: https://www.courtlistener.com/api/rest/v4/search/?q=antitrust&type=r

You can observe that the first attorney is listed as James F Keller, but the first attorney_id is 269313, which belongs to a different attorney. As a result, the attorney and attorney_id lists do not match due to the differing order.

This issue also occurs with other party related fields such as party, party_id, firm, and firm_id.

The problem is that we're using a set() to build these lists. Since sets in Python are unordered, the order of values added to the set is not guaranteed.

To resolve this, we should ensure that the lists of parties maintain the correct order. Using a list() instead of a set() may be sufficient, as long as we take care to prevent duplicates when indexing parties.

@mlissner
Copy link
Member

mlissner commented Oct 3, 2024

Thanks Alberto. Seems simple enough to fix going forward, but I assume the real fix will require a full re-index. So it goes!

@albertisfu
Copy link
Contributor Author

Yeah that's correct this fix would require a full-reindex but only for Dockets.

We already have a reindex of dockets planned for a different issue related to parties:

https://github.com/freelawproject/infrastructure/issues/157

So perhaps that re-index can wait a bit and address this issue at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants