govtrack.us-web icon indicating copy to clipboard operation
govtrack.us-web copied to clipboard

Search should return an exact match of a bill title as the first result

Open GPHemsley opened this issue 10 years ago • 2 comments

I'm not sure how search is weighted, but it doesn't seem to prioritize the bill title over other text.

For example, if I search for the "Disaster Relief Appropriations Act, 2013", I should get this bill as the first result:

https://www.govtrack.us/congress/bills/113/hr152

Instead, I get these results, where the correct bill isn't even on the first page:

https://www.govtrack.us/congress/bills/browse?congress=ALL&sort=relevance&text=Disaster%20Relief%20Appropriations%20Act,%202013

In fact, even if I narrow the search down to only bills signed by the President, it still only comes up as the second result:

https://www.govtrack.us/congress/bills/browse?congress=ALL&sort=relevance&current_status=28&text=Disaster%20Relief%20Appropriations%20Act,%202013

It would be helpful if the search could go straight to the bill page, like it does when you search for "P.L.", but at the very least it should show bill title matches above other matches.

GPHemsley avatar Nov 07 '13 02:11 GPHemsley

Agreed. It's not weighted at all now. Not sure but the Field Boost here might do it: https://django-haystack.readthedocs.org/en/latest/boost.html. I'll try that.

JoshData avatar Nov 22 '13 20:11 JoshData

Actually. The default sort order is a modified prognosis score. It ignores relevancy. Any bills in which the words are contained are included in the search results. What I should do instead is use relevancy but boost with the modified prognosis score.

JoshData avatar Nov 22 '13 20:11 JoshData