openrural/openblock — pull request #1 by rebecca-caktus (2012-08-23 14:12:30+00:00)
Title: Search changes

In order to improve search results, as described in #63 in openrural/columbus-county-nc, I've made a number of small changes to the OpenBlock search code.

In ``ebpub.ebpub.db.views.search``:

- **For ambiguous addresses, show results similar to ambiguous Blocks.** Both addresses and Blocks make use of the block disambiguation page. This is because the lowest-level at which one can search is a Block (rather than a specific address).
- **Better sorting on ambiguous Blocks.** We split up the results according to which city they are in, and order them by street number and direction (N, S, E, W). It's a great improvement on usability in a multi-city installation.
- **Commented out Place search things.** OpenBlock's place search is error-prone. Currently, we aren't using Places but this code should be revisited if we ever do.
- **Fixed 500 error bug when URL of address can't be reversed.** If the URL of an address cannot be reversed, then a 500 error was thrown. It seems preferable to simply not return a result.

in ``ebpub.ebpub.geocoder.base.AddressGeocoder._db_lookup``:

- **Don't suppress results if no street number is given.** Results were suppressed if a street number wasn't given with the location query. This makes a big difference in searching but I'm not sure what effect it has elsewhere.
- **When searching for results in a city, also search in cities with a matching normalized name.** That way, when someone searches for something in Whiteville that we've got listed in Whiteville Area, we can still find the results.

In ``ebpub.ebpub.geocoder.base.full_geocode``:

- **Allow more than one Location result to be returned.** So that we can return both Whiteville and Whiteville area when someone searches 'whiteville'.
- **Commented out Place search things.**