Skip to content

Commit

Permalink
feat(autocomplete): Turn off address parts scoring
Browse files Browse the repository at this point in the history
This change removes several `should` conditions from autocomplete
Elasticsearch queries.

After analysis in #1469 it appears
that these `should` conditions do not particularly influence address
rseults, but hinder POI results from appearing correctly.

While we might want to tweak things in the future, such as applying a
very small scoring boost for matching postal codes, in general for
autocomplete it seems these conditions are overall not helpful.

Closes #1308
  • Loading branch information
orangejulius committed Aug 12, 2020
1 parent befe777 commit 7d3e4a0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
6 changes: 0 additions & 6 deletions query/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ query.score( views.ngrams_last_token_only_multi( adminFields ), 'must' );
query.score( views.admin_multi_match_first( adminFields ), 'must');
query.score( views.admin_multi_match_last( adminFields ), 'must');

// address components
query.score( peliasQuery.view.address('housenumber') );
query.score( peliasQuery.view.address('street') );
query.score( peliasQuery.view.address('cross_street') );
query.score( peliasQuery.view.address('postcode') );

// scoring boost
query.score( peliasQuery.view.focus( views.ngrams_strict ) );
query.score( peliasQuery.view.popularity( peliasQuery.view.leaf.match_all ) );
Expand Down
10 changes: 0 additions & 10 deletions test/unit/fixture/autocomplete_single_character_street.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ module.exports = {
}
}],
'should':[
{
'match': {
'address_parts.street': {
'query': 'k road',
'cutoff_frequency': 0.01,
'boost': 1,
'analyzer': 'peliasQuery'
}
}
},
{
'function_score': {
'query': {
Expand Down

0 comments on commit 7d3e4a0

Please sign in to comment.