18F / fbopen

[DEPRECATED] An open API server, data import tools, and sample apps to help small businesses search for opportunities to work with the U.S. government.
Other
101 stars 45 forks source link

website: filter by full and/or partial NAICS code #46

Open aaronsnow opened 10 years ago

aaronsnow commented 10 years ago

This is really two features: 1) Filter by full NAICS code or by first two or three digits of NAICS code (e.g., 541) 2) When filtering by a full 6-digit NAICS code (e.g., naics=541430), if the query returns no results, fall back to searching for results that match the first three digits (e.g., 541).

Suggested by @cjoh

Note that this is already supported by the API, just not the website. E.g.:

Exact NAICS match on 541712: http://api.data.gov/gsa/fbopen/v0/opps?q=software+development&fq=FBO_NAICS:541712&api_key=DEMO_KEY

Three-digit NAICS match on 541_: http://api.data.gov/gsa/fbopen/v0/opps?q=software+development&fq=FBO_NAICS:541_&api_key=DEMO_KEY

Match any NAICS code in the range 541500-541800: http://api.data.gov/gsa/fbopen/v0/opps?q=software+development&fq=FBO_NAICS:{541500%20TO%20541800}&api_key=DEMO_KEY

Etc.

arowla commented 10 years ago

You beat me by four minutes (Issue #47). I still think that the web client should not be adding &naics= onto every query string.

arowla commented 10 years ago

I think 2) is a reasonable compromise in the case that there isn't any result for that q + FBO_NAICS. However, I'm hesitant to do that without letting the user know that's what's going on. Should we throw up a message to the user about the modified search? Or perhaps a breadcrumb-ish thing (shown in all cases) reiterating their search parameters back to them at the top of the results would be enough.

aaronsnow commented 10 years ago

Agree re: being clear on what they asked for vs. what's returned.

Instead of being more inclusive than they asked, maybe just make the suggestion to the user, with a prefab link to that broader search, e.g.,

Your search returned no results. Maybe broaden your search to include other NAICS codes in the same industry?

arowla commented 10 years ago

I like that idea. Gives the user control, and is arguably easier on our end, without having to make N round-trips to the API to guess at a search with results.

aaronsnow commented 10 years ago

Also note: this works only for FedBizOpps opportunities. grants.gov listings do not have NAICS codes.

kaitlin commented 10 years ago

For grants.gov, we should probably allow filtering by CFDA number, and I think there's some other category codes?