Skip to content

improved sorting for addresses with matching postcode - #91

Merged
orangejulius merged 1 commit into
masterfrom
address_search_using_ids
Nov 2, 2018
Merged

improved sorting for addresses with matching postcode#91
orangejulius merged 1 commit into
masterfrom
address_search_using_ids

Conversation

@missinglink

@missinglink missinglink commented Oct 30, 2018

Copy link
Copy Markdown
Member

I was alerted to this issue when investigating an issue of poor locality matching in Australia:

/v1/search?text=22 HENSON STREET, NSW, 2204

1) 22 Henson Street, Brighton-le-Sands, NSW, Australia
2) 22 Henson Street, Dulwich Hill, NSW, Australia
3) 22 Henson Street, Summer Hill (Ashfield), NSW, Australia
4) 22A Henson Street, Summer Hill (Ashfield), NSW, Australia
5) 22 Henson Street, Guildford, NSW, Australia

The issue is that the user supplied a postcode 2204 which was parsed correctly and matched record number 2.

If record 2. matched on the postcode, it should really be scored as no. 1

The reason for this is that the address_search_using_ids query doesn't include any boosting for postalcode matches.

This PR adds an extra query clause for address queries which prioritises addresses with a matching postcode over others, so they sort higher.

/v1/search?text=233 ne 3rd ave, 97124

# before
1) 233 NE 3rd Ave, Canby, OR, USA (97013)
2) 233 NE 3rd Ave, Hillsboro, OR, USA (97124)

# after
1) 233 NE 3rd Ave, Hillsboro, OR, USA (97124)
2) 233 NE 3rd Ave, Canby, OR, USA (97013)

orangejulius added a commit to pelias/acceptance-tests that referenced this pull request Nov 2, 2018

@orangejulius orangejulius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and this does indeed fix the issue. Acceptance test added

…queries which prioritises addresses with a matching postcode over others
@orangejulius
orangejulius force-pushed the address_search_using_ids branch from 51e6f9e to 9ee7b3d Compare November 2, 2018 21:46
@orangejulius
orangejulius merged commit 7ba9dc2 into master Nov 2, 2018
@orangejulius
orangejulius deleted the address_search_using_ids branch November 2, 2018 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants