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

Adding support for unit field in structured search. #1127

Merged

Conversation

sweco-semhul
Copy link
Contributor

If libpostal finds it in input use it for searching.
E.g. if address is set to: "Rådhusvej 20 1 th"
libpostal will parse it to:

[
    {
		"label": "road",
		"value": "Rådhusvej"
	},
	{
		"label": "house_number",
		"value": "20"
	},
	{
		"label": "unit",
		"value": "1 th"
	}
]

then, as for house_number, unit should be added to parsed_text and removed from parsed_text.address to result in:

"parsed_text": {
	"number": "20",
	"street": "Rådhusvej",
	"unit": "1 th"
} 

today the result is

"parsed_text": {
	"number": "20",
	"street": "Rådhusvej  1 th"
} 

this PR resolves it and adds a test for it.

@orangejulius
Copy link
Member

Hello again @sweco-semhul,
This PR looks good, and doesn't break any acceptance tests. Thanks!

And although it's been a while, we still plan on merging your other PRs related to pelias/pelias#618. It's on the todo list...somewhere with everything else to do in this wild year :)

@orangejulius orangejulius merged commit 647b48c into pelias:master Apr 30, 2018
@pelias-bot
Copy link

🎉 This PR is included in version 3.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants