codeforamerica / fast_pass

Las Vegas Development Opportunity Finder
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

NAICS business category endpoint #4

Closed lovehandle closed 11 years ago

lovehandle commented 11 years ago

Create a NAICS business category endpoint that takes a list of keywords and returns a JSON array of NAICS business categories.

Query:

curl http://local:3000/categories/search\?q\=Finfish Farming and Fish Hatcheries

Response:

[{"code":112511,"title":"Finfish Farming and Fish Hatcheries","description":["This U.S. industry comprises establishments primarily engaged in (1) farm raising finfish (e.g., catfish, trout, goldfish, tropical fish, minnows) and/or (2) hatching fish of any kind."]},{"code":112519,"title":"Other Aquaculture","description":["This U.S. industry comprises establishments primarily engaged in (1) farm raising of aquatic animals (except finfish and shellfish) and/or (2) farm raising of aquatic plants.  Alligator, algae, frog, seaweed, or turtle production is included in this industry."]},{"code":11411,"title":"Fishing","description":["This industry comprises establishments primarily engaged in the commercial catching or taking of finfish, shellfish, or miscellaneous marine products from a natural habitat, such as the catching of bluefish, eels, salmon, tuna, clams, crabs, lobsters, mussels, oysters, shrimp, frogs, sea urchins, and turtles."]},{"code":114111,"title":"Finfish Fishing","description":["This U.S. industry comprises establishments primarily engaged in the commercial catching or taking of finfish (e.g., bluefish, salmon, trout, tuna) from their natural habitat."]}]}]
louh commented 11 years ago

Currently, NAICS API endpoint is set to only search on 6-digit codes. This prevents duplicate titles from showing up. For instance, it's very common for 5-digit codes to only refer to their 6-digit versions and this is set to prevent both from showing up in a list of search results.

lovehandle commented 11 years ago

I've created a route for NAICS category search on the following branch: backend. The route is exposed as follows:

Currently, the route requires that categories exist within the database, and it could be optimized with regard to how it's searching. We should discuss alternative searching strategies and think through what information needs to be returned from this route. Let's move that discussion to an alternate thread.

Marking as closed