Opened 12 years ago

Closed 12 years ago

#1249 closed defect (fixed)

Search with partial postcode confuses namefinder

Reported by: eda@… Owned by: David Earl
Priority: minor Milestone:
Component: namefinder Version:
Keywords: Cc:


Searching for '1 Snowden Street, London EC2A' produces no results, while searching for '1 Snowden Street, London' works.

The EC2A is the first part of a United Kingdom postcode. These postcodes are two words and by convention you can give just the first part to refer to an area. Existing maps such as the 'London A-Z' use the first part of the postcode to disambiguate street names.

In general I suggest that if a search finds no results, but there is something that looks like a postal code at the end of the string, try removing that bit and retrying the search.

Change History (4)

comment:1 Changed 12 years ago by eda@…

Um, actually the '1' at the beginning of the address might need to be removed too. This is another enhancement that should be added: if a search returns no results then strip off the house number at the front and try again.

comment:2 Changed 12 years ago by Tom Hughes

Component: adminnamefinder
Owner: changed from Tom Hughes to David Earl

comment:3 Changed 12 years ago by David Earl

Namefinder was never set up to search for partial postcodes, so it's not surprising it didn't find them. It was doing a search just like any other.

Rather than build this in as a special case, what I've done is to insert nodes into the OSM data for each of the 3,000-odd postcode area centroids, so that a search for them finds those nodes like any other. (This also opens up the possibility of using this data to confine postcode searches to near the centroid - at the moment, a search for XX1 1YY can determine it should look for "Foobar Street, Cambridge" and then finds that street in Cambridge Massachusetts because there happens to be one there too).

comment:4 Changed 12 years ago by David Earl

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.