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

Add complicated house number filter #133

Closed
wants to merge 2 commits into from

Conversation

trescube
Copy link
Contributor

@trescube trescube commented Jun 7, 2016

DO NOT MERGE, this work has been merged in to the elasticsearch2 branch


This remarkably convoluted series of Lucene token filters is bundled into an analyzer called goldbergianPeliasHousenumber and allows us to remove house numbers from prefix-ngramming logic.

Here's an example, 14a w main st:

surround_single_characters_with_!s  -> [14a, !w!, main, st]
house_number_word_delimiter         -> [14, 14a, a, !w!, main, st]
remove_single_characters            -> [14, 14a, !w!, main, st]
surround_house_numbers_with_!s      -> [!14!, !14a!, !w!, main, st]
peliasOneEdgeGramFilter             -> [!, !1, !14, !14!, !, !1, !14, !14a, !14a!, !, !w, !w!, m, ma, mai, main, s, st]
eliminate_tokens_starting_with_!    -> ["", "", "", !14!, "", "", "", "", !14a!, "", "", w, m, ma, mai, main, s, st]
remove_encapsulating_!s             -> ["", "", "", 14, "", "", "", "", 14a, "", "", w, m, ma, mai, main, s, st]
notnull                             -> [14, 14a, w, m, ma, mai, main, s, st]
unique                              -> [14, 14a, w, m, ma, mai, main, s, st]

trescube added 2 commits June 7, 2016 15:54
Created a super-convoluted, yet necessary, series of built-in filters to not prefix n-gram house numbers.  That is, from `14a`, we want `14` and `14a` but not `1`.

eg: 14a w main st
surround_single_characters_with_!s  -> [14a, !w!, main, st]
house_number_word_delimiter         -> [14, 14a, a, !w!, main, st]
remove_single_characters            -> [14, 14a, !w!, main, st]
surround_house_numbers_with_!s      -> [!14!, !14a!, !w!, main, st]
peliasOneEdgeGramFilter             -> [!, !1, !14, !14!, !, !1, !14, !14a, !14a!, !, !w, !w!, m, ma, mai, main, s, st]
eliminate_tokens_starting_with_!    -> ["", "", "", !14!, "", "", "", "", !14a!, "", "", w, m, ma, mai, main, s, st]
remove_encapsulating_!s             -> ["", "", "", 14, "", "", "", "", 14a, "", "", w, m, ma, mai, main, s, st]
notnull                             -> [14, 14a, w, m, ma, mai, main, s, st]
unique                              -> [14, 14a, w, m, ma, mai, main, s, st]
@missinglink missinglink self-assigned this Jun 8, 2016
@orangejulius
Copy link
Member

This fails on my machine too. Double check you committed everything?

@orangejulius
Copy link
Member

This was merged in #138

@orangejulius
Copy link
Member

Also the test failures are due to the Elasticsearch version on Travis. #139 tracks fixing that

orangejulius added a commit that referenced this pull request Oct 31, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
orangejulius added a commit that referenced this pull request Oct 31, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
orangejulius added a commit that referenced this pull request Oct 31, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
orangejulius added a commit that referenced this pull request Nov 7, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
missinglink pushed a commit that referenced this pull request Nov 20, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
missinglink pushed a commit that referenced this pull request Nov 20, 2019
This removes the complex filtering logic known as the "complicated
housenumber filter", or sometimes even the "goldbergian housenumber
filter", originally described in
#133 and merged as part of our ES2
upgrade (#138).

The housenumber filter was made quite a long time ago, with the
intention of removing partial numeric tokens.

It's quite a lot of code, rather hard to understand, and may actually
cause more problems than it sovles.

In particular, fully numeric postal codes cannot be found with
autocomplete until the postal code is entered completely (see
pelias/pelias#676).

Since this code was written, we've improved autocomplete considerably,
and having some tokens missing could be resulting in autocomplete not
doing its job as well as it could.

However, there could also be downsides: this will increase the hit count
for numeric inputs dramatically, so it could cause more slow queries.
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