usgpo / api

services to access govinfo content and metadata
https://api.govinfo.gov
Other
183 stars 58 forks source link

Search API for STATUTE collection returns different results than govinfo.gov UI #154

Closed alenafirefly closed 7 months ago

alenafirefly commented 7 months ago

When calling API POST https://api.govinfo.gov/search with the below request body, I'm getting 2 results. { "query": "collection:(STATUTE) AND congress:82 AND publishdate:range(1951-01-03,1953-01-04)", "pageSize": 1000, "offsetMark": "*", "sorts": [ { "field": "publishdate", "sortOrder": "ASC" } ], "historical": true, "resultLevel": "package" }

In the meantime, govingo.gov search page shows 1793 results for query string: publishdate:range(1951-01-03,1953-01-04) and selected filters "Congress Number": 82 and "Collection": "United States Statutes at Large", as shown on below screenshot.

image
jonquandt commented 7 months ago

Setting resultLevel to "default" should give you the same results.

Alternatively, in the GovInfo UI, you could do a browse by date for all dates and then search within with your specific search parameters to only return package-level results that are responsive. You could also limit to your specific dates.

Here is a link that starts with your publish range and then searches within to add congress:82 and collection:statute

https://www.govinfo.gov/app/search/%7B%22query%22%3A%22publishdate%3Arange(1951-01-01%2C1953-01-04)%20and%20congress%3A82%20collection%3Astatute%22%2C%22browseByDate%22%3Atrue%2C%22sortBy%22%3A%221%22%2C%22offset%22%3A0%7D

By default, the GovInfo UI search tries to return results at a smaller/more targeted level. The browse by date function forces it to return at the package level only.

alenafirefly commented 7 months ago

Hello @jonquandt , Thanks a lot for the clarification! Regards.

alenafirefly commented 7 months ago

resolved