From ac01d72477be0f13132653e673a06648cbb38b17 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 2 Nov 2015 12:55:35 +0100 Subject: [PATCH 1/2] update address matching analyzers. related https://github.com/pelias/schema/pull/77 --- query/autocomplete_defaults.js | 6 +++--- query/reverse_defaults.js | 6 +++--- query/search_defaults.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/query/autocomplete_defaults.js b/query/autocomplete_defaults.js index b61e84ac..f6a9638c 100644 --- a/query/autocomplete_defaults.js +++ b/query/autocomplete_defaults.js @@ -38,15 +38,15 @@ module.exports = extend( false, peliasQuery.defaults, { 'function_score:score_mode': 'avg', 'function_score:boost_mode': 'replace', - 'address:housenumber:analyzer': 'standard', + 'address:housenumber:analyzer': 'peliasHousenumber', 'address:housenumber:field': 'address.number', 'address:housenumber:boost': 2, - 'address:street:analyzer': 'standard', + 'address:street:analyzer': 'peliasStreet', 'address:street:field': 'address.street', 'address:street:boost': 5, - 'address:postcode:analyzer': 'standard', + 'address:postcode:analyzer': 'peliasZip', 'address:postcode:field': 'address.zip', 'address:postcode:boost': 3, diff --git a/query/reverse_defaults.js b/query/reverse_defaults.js index b61e84ac..f6a9638c 100644 --- a/query/reverse_defaults.js +++ b/query/reverse_defaults.js @@ -38,15 +38,15 @@ module.exports = extend( false, peliasQuery.defaults, { 'function_score:score_mode': 'avg', 'function_score:boost_mode': 'replace', - 'address:housenumber:analyzer': 'standard', + 'address:housenumber:analyzer': 'peliasHousenumber', 'address:housenumber:field': 'address.number', 'address:housenumber:boost': 2, - 'address:street:analyzer': 'standard', + 'address:street:analyzer': 'peliasStreet', 'address:street:field': 'address.street', 'address:street:boost': 5, - 'address:postcode:analyzer': 'standard', + 'address:postcode:analyzer': 'peliasZip', 'address:postcode:field': 'address.zip', 'address:postcode:boost': 3, diff --git a/query/search_defaults.js b/query/search_defaults.js index b61e84ac..f6a9638c 100644 --- a/query/search_defaults.js +++ b/query/search_defaults.js @@ -38,15 +38,15 @@ module.exports = extend( false, peliasQuery.defaults, { 'function_score:score_mode': 'avg', 'function_score:boost_mode': 'replace', - 'address:housenumber:analyzer': 'standard', + 'address:housenumber:analyzer': 'peliasHousenumber', 'address:housenumber:field': 'address.number', 'address:housenumber:boost': 2, - 'address:street:analyzer': 'standard', + 'address:street:analyzer': 'peliasStreet', 'address:street:field': 'address.street', 'address:street:boost': 5, - 'address:postcode:analyzer': 'standard', + 'address:postcode:analyzer': 'peliasZip', 'address:postcode:field': 'address.zip', 'address:postcode:boost': 3, From c17a0dbc54220d5f8929fa81a30c45612c69e700 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 2 Nov 2015 16:33:21 +0100 Subject: [PATCH 2/2] increase postcode weights, add postcode to leftovers --- helper/adminFields.js | 5 +++-- query/autocomplete_defaults.js | 2 +- query/search_defaults.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/helper/adminFields.js b/helper/adminFields.js index 275e03c1..af6ac432 100644 --- a/helper/adminFields.js +++ b/helper/adminFields.js @@ -10,7 +10,8 @@ var ADMIN_FIELDS = [ 'admin2', 'local_admin', 'locality', - 'neighborhood' + 'neighborhood', + 'address.zip' ]; /** @@ -41,4 +42,4 @@ function getAvailableAdminFields(schema, expectedFields, logger) { return available; } -module.exports = getAvailableAdminFields; \ No newline at end of file +module.exports = getAvailableAdminFields; diff --git a/query/autocomplete_defaults.js b/query/autocomplete_defaults.js index f6a9638c..401ebf73 100644 --- a/query/autocomplete_defaults.js +++ b/query/autocomplete_defaults.js @@ -48,7 +48,7 @@ module.exports = extend( false, peliasQuery.defaults, { 'address:postcode:analyzer': 'peliasZip', 'address:postcode:field': 'address.zip', - 'address:postcode:boost': 3, + 'address:postcode:boost': 20, 'admin:alpha3:analyzer': 'standard', 'admin:alpha3:field': 'alpha3', diff --git a/query/search_defaults.js b/query/search_defaults.js index f6a9638c..401ebf73 100644 --- a/query/search_defaults.js +++ b/query/search_defaults.js @@ -48,7 +48,7 @@ module.exports = extend( false, peliasQuery.defaults, { 'address:postcode:analyzer': 'peliasZip', 'address:postcode:field': 'address.zip', - 'address:postcode:boost': 3, + 'address:postcode:boost': 20, 'admin:alpha3:analyzer': 'standard', 'admin:alpha3:field': 'alpha3',