Search on homepage.html only works for ZIPs #63

rtburg opened this Issue Jul 5, 2012 · 6 comments


None yet

2 participants

rtburg commented Jul 5, 2012

Search for "Whiteville" and "Hammond" (as in "Hammond Drive") yields "Location Not Found"

Search that appear to work OK:

  • zip codes
  • "Hammond Drive"
  • "Hammond Dr."
  • "235 Hammond"
@ghost ghost assigned sarahdooley and ghost Jul 5, 2012

[note from meeting: this one is possibly non-trivial but is high priority]


@rebecca-caktus : how many hours would you estimate for this task?

@ghost Unknown added a commit that referenced this issue Jul 23, 2012
Rebecca Lovewell refs #63 - Search template overrides d918c0f
ghost commented Jul 23, 2012

@rtburg I made a few changes to the OpenBlock search implementation to make it a little more friendly. Search is still quirky, so I'll explain how it works and we can decide what is most important to work on. OpenBlock search looks for matches in the following order:

1. Location

  • 'boardman' → If there is only one result, the user is redirected to the detail page.
  • 'whiteville' → If there are multiple results, the user is redirected to a disambiguation page.
  • 'whiteville area' → This search won't match a location, because the code checks against the normalized name, which is WHITEVILLE for both Whiteville area and Whiteville town limits.

2. Place
The current OpenBlock search mishandles Places: if Place results are found then either no results are returned, or a 500 error will be thrown. Because we don't have any Places at the moment, I'll comment that code out. But if we want to enable Place search in the future, then some (potentially significant) work will be required.

3. Geocode

  • '288 hammond' → If there is only one result, the user is redirected to the detail page.
  • '235 hammond' or 'hammond' → If there are multiple results, the user is redirected to a disambiguation page. Note that each disambiguation entry is actually a Block (such that there may be multiple entries for each Street). It may be more helpful to direct users to Street pages.
  • '12345 hammond' → When a user gives what looks like a full address with a valid street name, but invalid block, then the user is directed to a different disambiguation page. Again, it may be more helpful to have a page which disambiguates different Hammond streets (or directs the user to the Street detail page).
  • '28320' → Zip codes are handled here as well.
  • 'main street whiteville' → This does not work because here the code attempts to match against the name rather than the normalized name ('Whiteville area' and 'Whiteville town limits') In contrast, 'main street whiteville town limits' does work.

4. Special Case
The code attempts to look up the query in the SearchSpecialCase objects. This does not seem to be available in the admin at the moment, although I think that is a straightforward change if you would like to make use of this.

5. Zip Code

  • '12345' → Failing all other kinds of search, OpenBlock will see if the query looks like a zip code, and if so, it displays the valid zip codes for the county.

Some things to note:

  • Both Location and Place have related Synonym objects. For example, we could define 'tabor' as a synonym for Tabor City.
  • NewsItems are not searched using this view.

At this time I think it would be most helpful to improve the disambiguation page results & improve performance when searching for things like 'main street whiteville'. Please let us know your thoughts!

rtburg commented Jul 23, 2012

Nicely executed and documented.

Let's keep track of how long it took us to do this. At some point very soon I'm going to need to report to the Knight Foundation a list of all the "bug fixes" we've had to work on.

To deal with cases such as "'main street whiteville'" we can add some standing text to the "Location Not Found Page" that says "Here are some things you might want to try:

  1. Try searching for the name of the street, without the name of the town.
  2. Navigate our full list of streets to find news for an individual block. ..."

I'm not familiar at all with SearchSpecialCase objects, so I'll have to educate myself about those before I can reply.

There seems to be great advantage in create a couple of selectively useful synonym objects. Best use for those seems to be dealing with misspellings, because if I understand correctly "whiteville" cannot be a synonym for both Whiteville area and Whiteville Town Limits, correct?

Good to know about NewsItems not being searched using this view. I can't think of a good reason for that, can you?

Let's mark this issue down as "good enough for now" and come back to it later. Thanks again for the nice documentation, Rebecca.

ghost commented Jul 23, 2012

Note for later: The search changes in OpenBlock are in the search-changes branch in our fork, which is currently deployed on staging. When we finalize what we're going to do and/or move onto production, these changes will need to be merged into the openrural branch.

@ghost Unknown added a commit that referenced this issue Jul 30, 2012
Rebecca Lovewell refs #63 - Improvements to block and address disambiguation pages 62b33fe
@ghost Unknown added a commit that referenced this issue Jul 31, 2012
Rebecca Lovewell refs #63 - Added postdir to template 09b5dde
ghost commented Aug 23, 2012

The related OpenBlock search changes are enumerated in a pull request to our branch.

@ghost ghost was unassigned by rtburg Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment