Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with apostrophes and periods in place names? #19

Closed
JoeGermuska opened this issue Jul 16, 2014 · 4 comments
Closed

Problems with apostrophes and periods in place names? #19

JoeGermuska opened this issue Jul 16, 2014 · 4 comments

Comments

@JoeGermuska
Copy link
Member

A UserVoice support ticket revealed that our current place lookup mechanism doesn't handle names like "O'Fallon, MO"

This happens in all of the place lookup fields I've tried.

@caged
Copy link

caged commented May 27, 2015

I was looking for a bug to tackle and took a peek at this one. This appears to be an issue at the census-api level. You can reproduce the behavior by loading the API URL directly. I wasn't able to get the census-api side of things running locally, but it appears that these regexs might need some adjustments. In addition to apostrophes and periods, dashes are also problematic. For example, if you paste in "Miami-Dade," the resultset is empty.

@JoeGermuska
Copy link
Member Author

sorry, meant to reply to this days ago, but it got lost in the tab forest...

Care to give us some more info (here or elsewhere) on the issues in getting the API running locally?

@JoeGermuska
Copy link
Member Author

Verified that "O'Fallon" is still an issue.

The other thing, about pasting "miami-dade" into the search box, currently functions correctly

@Joonpark13 Joonpark13 modified the milestone: Summer 2016 Jul 27, 2016
@tuchandra tuchandra self-assigned this Jul 28, 2016
@tuchandra
Copy link
Member

tuchandra commented Jul 28, 2016

Our (@Joonpark13 and my) implementation of full text search (PR #165) now handles these. Dashes and periods were not a problem to begin with, but apostrophes still were. We discovered that, when the search index was built, apostrophes were treated as delimiters between words (i.e., spaces); a change to api.py to do the same solves the issue.

Test cases: o'fallon, ft. lauderdale, st. louis, miami-dade.

tuchandra added a commit to censusreporter/census-api that referenced this issue Jul 28, 2016
Replacing apostrophes with spaces in the query string, which is
what postgres did when building the search index, is done to allow
searches like "O'Fallon" to work properly.

Closes censusreporter/censusreporter#19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants