From aa458a1fdcb79a9404937a392300d06927e7d8ed Mon Sep 17 00:00:00 2001 From: missinglink Date: Thu, 12 Aug 2021 10:59:09 +0200 Subject: [PATCH] feat(autocomplete): add macrocounty to list of potential admin matching fields --- query/autocomplete_defaults.js | 5 +++++ test/unit/fixture/autocomplete_linguistic_multiple_tokens.js | 1 + test/unit/fixture/autocomplete_linguistic_with_admin.js | 1 + test/unit/fixture/autocomplete_single_character_street.js | 1 + 4 files changed, 8 insertions(+) diff --git a/query/autocomplete_defaults.js b/query/autocomplete_defaults.js index ca8eca7d7..ad206a6ce 100644 --- a/query/autocomplete_defaults.js +++ b/query/autocomplete_defaults.js @@ -106,6 +106,11 @@ module.exports = _.merge({}, peliasQuery.defaults, { 'admin:county:boost': 1, 'admin:county:cutoff_frequency': 0.01, + 'admin:macrocounty:analyzer': 'peliasAdmin', + 'admin:macrocounty:field': 'parent.macrocounty.ngram', + 'admin:macrocounty:boost': 1, + 'admin:macrocounty:cutoff_frequency': 0.01, + 'admin:localadmin:analyzer': 'peliasAdmin', 'admin:localadmin:field': 'parent.localadmin.ngram', 'admin:localadmin:boost': 1, diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js index 157c224d1..9a92396d7 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js @@ -20,6 +20,7 @@ module.exports = { 'parent.dependency.ngram^1', 'parent.macroregion.ngram^1', 'parent.region.ngram^1', + 'parent.macrocounty.ngram^1', 'parent.county.ngram^1', 'parent.localadmin.ngram^1', 'parent.locality.ngram^1', diff --git a/test/unit/fixture/autocomplete_linguistic_with_admin.js b/test/unit/fixture/autocomplete_linguistic_with_admin.js index e162915fb..efd2d7bab 100644 --- a/test/unit/fixture/autocomplete_linguistic_with_admin.js +++ b/test/unit/fixture/autocomplete_linguistic_with_admin.js @@ -19,6 +19,7 @@ module.exports = { 'parent.dependency.ngram^1', 'parent.macroregion.ngram^1', 'parent.region.ngram^1', + 'parent.macrocounty.ngram^1', 'parent.county.ngram^1', 'parent.localadmin.ngram^1', 'parent.locality.ngram^1', diff --git a/test/unit/fixture/autocomplete_single_character_street.js b/test/unit/fixture/autocomplete_single_character_street.js index 1c7e421e2..730b8eabb 100644 --- a/test/unit/fixture/autocomplete_single_character_street.js +++ b/test/unit/fixture/autocomplete_single_character_street.js @@ -17,6 +17,7 @@ module.exports = { 'parent.dependency.ngram^1', 'parent.macroregion.ngram^1', 'parent.region.ngram^1', + 'parent.macrocounty.ngram^1', 'parent.county.ngram^1', 'parent.localadmin.ngram^1', 'parent.locality.ngram^1',