From 0c67347c273deaa7cfacc5a0f1e91c7877a7f669 Mon Sep 17 00:00:00 2001 From: missinglink Date: Thu, 28 Apr 2016 14:41:57 +0200 Subject: [PATCH] enable borough for search --- query/search.js | 1 + test/unit/fixture/search_full_address.js | 8 ++++++++ test/unit/fixture/search_partial_address.js | 8 ++++++++ test/unit/fixture/search_regions_address.js | 8 ++++++++ 4 files changed, 25 insertions(+) diff --git a/query/search.js b/query/search.js index 9f0a792c..77fcb3f5 100644 --- a/query/search.js +++ b/query/search.js @@ -30,6 +30,7 @@ query.score( peliasQuery.view.admin('country_a') ); query.score( peliasQuery.view.admin('region') ); query.score( peliasQuery.view.admin('region_a') ); query.score( peliasQuery.view.admin('county') ); +query.score( peliasQuery.view.admin('borough') ); query.score( peliasQuery.view.admin('localadmin') ); query.score( peliasQuery.view.admin('locality') ); query.score( peliasQuery.view.admin('neighbourhood') ); diff --git a/test/unit/fixture/search_full_address.js b/test/unit/fixture/search_full_address.js index 8a8290ab..bef0a7b0 100644 --- a/test/unit/fixture/search_full_address.js +++ b/test/unit/fixture/search_full_address.js @@ -139,6 +139,14 @@ module.exports = { 'analyzer': vs['admin:county:analyzer'] } } + }, { + 'match': { + 'parent.borough': { + 'query': 'new york', + 'boost': vs['admin:borough:boost'], + 'analyzer': vs['admin:borough:analyzer'] + } + } }, { 'match': { 'parent.localadmin': { diff --git a/test/unit/fixture/search_partial_address.js b/test/unit/fixture/search_partial_address.js index 6c4174b6..290d28e5 100644 --- a/test/unit/fixture/search_partial_address.js +++ b/test/unit/fixture/search_partial_address.js @@ -107,6 +107,14 @@ module.exports = { 'analyzer': vs['admin:county:analyzer'] } } + }, { + 'match': { + 'parent.borough': { + 'query': 'new york', + 'boost': vs['admin:borough:boost'], + 'analyzer': vs['admin:borough:analyzer'] + } + } }, { 'match': { 'parent.localadmin': { diff --git a/test/unit/fixture/search_regions_address.js b/test/unit/fixture/search_regions_address.js index e0c05f3c..343dfc43 100644 --- a/test/unit/fixture/search_regions_address.js +++ b/test/unit/fixture/search_regions_address.js @@ -123,6 +123,14 @@ module.exports = { 'analyzer': vs['admin:county:analyzer'] } } + }, { + 'match': { + 'parent.borough': { + 'query': 'manhattan', + 'boost': vs['admin:borough:boost'], + 'analyzer': vs['admin:borough:analyzer'] + } + } }, { 'match': { 'parent.localadmin': {