codeforamerica / ohana-api

The open source API directory of community social services.
http://ohana-api-demo.herokuapp.com/api
BSD 3-Clause "New" or "Revised" License
185 stars 344 forks source link

Service name doesn't seem to be included in search index #364

Closed monfresh closed 9 years ago

monfresh commented 9 years ago

One of the service names in the example data is "Passport Photos", but when I search for keyword=passport, or even keyword=Passport Photos, no results show up. Looking at the tsv_body column for the example location, I don't see the words passport or photos. The SQL for the other service attributes, such as description, seems to be the same as the one for name, so I'm not sure what's going on.

monfresh commented 9 years ago

I think description is not being included either. My guess is that those fields require string_agg like the categories and keywords, which do work.

monfresh commented 9 years ago

I can't reproduce this. I think it might have been because of the way the DB was populated on the demo website. After I saved the example service (thereby triggering the full text search index to update), I was able to get results that match both the service name and description. I also wrote tests for this in the code and they passed.