Skip to content

feat(addressSearchUsingIds): Set default street slop to 1#1322

Merged
orangejulius merged 1 commit intomasterfrom
addressUsingIds-slop
Oct 3, 2019
Merged

feat(addressSearchUsingIds): Set default street slop to 1#1322
orangejulius merged 1 commit intomasterfrom
addressUsingIds-slop

Conversation

@orangejulius
Copy link
Copy Markdown
Member

Combined with pelias/query#101, this change allows for improved matching of streets when using the addressSearchUsingIDs query (the first query executed by the search endpoint).

Essentially, by allowing a slop of 1 in the match_phrase clauses of the Elasticsearch query, its now possible to omit a single word in the middle of a street name and still match it. Omitting words at the start or end of the street name has been supported since pelias/schema#310.

Some examples of where this helps:

Actual street name Newly matching input text
SE Martin Luther King Jr Blvd Martin Luther King Blvd
Carrer de Balmes Carrer Balmes

@orangejulius orangejulius requested a review from Joxit June 19, 2019 21:07
@orangejulius
Copy link
Copy Markdown
Member Author

@Joxit i would be curious to hear if this PR allows any interesting new queries to pass in France :)

@orangejulius
Copy link
Copy Markdown
Member Author

The acceptance tests all pass with this change, and I'll also add some additional acceptance tests for new queries that now pass.

Copy link
Copy Markdown
Member

@Joxit Joxit left a comment

Choose a reason for hiding this comment

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

I did some tests, with my favourite address 40 Rue de l'Arsenal, Bordeaux. It seems to works with 40 Rue l'Arsenal, Bordeaux (but not for 40 Rue Arsenal, bordeaux but it's normal 😄.
The same for Boulevard du Général de Gaulle, Sarcelles, France and Boulevard Général de Gaulle, Sarcelles, France

I haven't example where the slop should be higher than 1 🤔. This will not replace a fuzzy search, but it's good enough 👍

So... LGTM 🚀

Copy link
Copy Markdown
Member

@missinglink missinglink left a comment

Choose a reason for hiding this comment

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

👍

orangejulius added a commit to pelias/query that referenced this pull request Oct 3, 2019
This change builds on the previous series of PRs
(#112,
and #111) to support the `slop`
parameter on the `match_phrase` queries responsible for handling street
addresses.

Replaces #101
Connects pelias/api#1322
@orangejulius orangejulius force-pushed the addressUsingIds-slop branch 2 times, most recently from 92e66f5 to 3e64775 Compare October 3, 2019 18:35
Combined with pelias/query#101, this change
allows for improved matching of streets when using the
addressSearchUsingIDs query (the first query executed by the search
endpoint).

Essentially, by allowing a `slop` of 1 in the `match_phrase` clauses of
the Elasticsearch query, its now possible to omit a single word _in the
middle_ of a street name and still match it. Omitting words at the start
or end of the street name has been supported since
pelias/schema#310.

Some examples of where this helps:

| Actual street name | Newly matching input text |
| ---                | ---                       |
| SE Martin Luther King Jr Blvd | Martin Luther King Blvd |
| Carrer de Balmes | Carrer Balmes |

Since pelias/query#113 has been merged, this
commit will result in changes to how queries behave.
@orangejulius orangejulius merged commit 142a96f into master Oct 3, 2019
@Joxit Joxit deleted the addressUsingIds-slop branch October 3, 2019 21:39
orangejulius added a commit to pelias/acceptance-tests that referenced this pull request Oct 3, 2019
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.

3 participants