Closed flooie closed 2 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.
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.
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
A fix for this is in a new branch for fixes. Although I'm not really seeing it occur currently.
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
?
Thats an excellent point. I think there is some good cleanup ability in this without having to hack it.
@mlissner What do you think?
I no longer think we need to expand it - assuming you approve my new filter and ordering on names.
I just closed this, but I might as well use it to track a few more items I just found:
page=undefined
on the end. Not ideal.[x] This string on the Person page should be tweaked a bit:
An annual financial disclosure by Federal judges, magistrates and clerks of the court.
Probably it could say this instead:
Annually filed financial disclosure records for federal judges, magistrates and clerks of the court.
For these last three items:
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.
This should be an easy fix we should do.
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.
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.
@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.
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:
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. :)
yes. its an investments field... I think.
We've released the financial disclosure database. Hooray.
Now it's time to fix all the bugs we've now found.