freelawproject / courtlistener

A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
https://www.courtlistener.com
Other
541 stars 149 forks source link

Financial Disclosure Release Fix List #1788

Closed flooie closed 2 years ago

flooie commented 3 years ago

We've released the financial disclosure database. Hooray.

Now it's time to fix all the bugs we've now found.

flooie commented 3 years ago

I think the search engine is not adequate to find judges. The only way to get to Clarence Thomas is to key in Claren...

Thomas doesn't work Clarence Thomas doesn't work either.

mlissner commented 3 years ago

Well, you found the edge case we were after. Good one. I don't see any solutions I love:

I guess I like option 3 best. Just return like 50 results by default (assuming performance is fine), and then let people scroll inside the drop down. I bet performance would be fine.

flooie commented 3 years ago

I think the solution is to insert this into the first pass of the full name query. If you find an exact match on the first two words - ... just return it. so if you do C Thomas - it'll return him exactly.

if len(query_parts) == 2:
     first_last = queryset.filter(
        Q(name_first__icontains=query_parts[0]) & Q(name_last__icontains=query_parts[1])
    )
   last_first = queryset.filter(
        Q(name_first__icontains=query_parts[1]) & Q(name_last__icontains=query_parts[0])
    )
    if len(first_last) == 1:
        return first_last
   elif len(last_first) == 1:
        return last_first
flooie commented 3 years ago

A fix for this is in a new branch for fixes. Although I'm not really seeing it occur currently.

mlissner commented 3 years ago

so if you do C Thomas, it'll return him exactly.

I'm not sold on this. It feels like a patch to make a specific way to query work better, but it doesn't fix the general problem of too many matches for whatever weird idea somebody has. Why not add a scrollbar in there?

I'm also seeing weird results for the query thomas c. I think it's because the c returns lots of weird results. Should these queries be using __istartswith instead of __icontains?

flooie commented 2 years ago

Thats an excellent point. I think there is some good cleanup ability in this without having to hack it.

flooie commented 2 years ago

@mlissner What do you think?

image

flooie commented 2 years ago

I no longer think we need to expand it - assuming you approve my new filter and ordering on names.

mlissner commented 2 years ago

I just closed this, but I might as well use it to track a few more items I just found:

mlissner commented 2 years ago

For these last three items:

  1. We can probably live without improving the load, I guess. It might be nice if the sidebar didn't show up on the left and then flash to the right, but I guess we can live with it for now.

  2. This should be an easy fix we should do.

  3. I don't know how to make these tables narrower unfortunately. We could use the value codes instead of writing out 1-15000 (A) or whatever, but that only gets you so far.

Maybe we just fix #2, and we say the rest are...fine.

mlissner commented 2 years ago

Did you verify this one is fixed? I don't recall seeing a fix for it come through:

When we don't know the page number for a row, we have links that say page=undefined on the end. Not ideal.

flooie commented 2 years ago

@mlissner I can't find an example to take a look at the page=undefined. But im also a little baffled by it because page must be saved as an integer to be in the database.

mlissner commented 2 years ago

yeah, weird. I see that in the model.

Check out Mrs. Trump though:

https://www.courtlistener.com/person/189/disclosure/25285/maryanne-trump-barry/

If you hover over the first little icon in the Positions table, it takes you to:

https://storage.courtlistener.com/us/federal/judicial/financial-disclosures/189/maryanne-trump-barry-disclosure.2003.pdf#page=undefined

mlissner commented 2 years ago

Maybe it's just that positions don't ever have page numbers and so shouldn't get page number links. Looks like that's the case. :)

flooie commented 2 years ago

yes. its an investments field... I think.