From a4f6e70d255cb5cd16cb2b15a25c9d01e3fdb296 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 11 Mar 2016 18:47:45 +0100 Subject: [PATCH] upgrade to pelias-query@6.1.0 --- package.json | 2 +- .../autocomplete_linguistic_final_token.js | 16 ++++----------- .../fixture/autocomplete_linguistic_focus.js | 16 ++++----------- ...tocomplete_linguistic_focus_null_island.js | 16 ++++----------- ...autocomplete_linguistic_multiple_tokens.js | 16 ++++----------- .../fixture/autocomplete_linguistic_only.js | 16 ++++----------- .../autocomplete_linguistic_with_admin.js | 18 +++++------------ test/unit/fixture/search_boundary_country.js | 16 ++++----------- test/unit/fixture/search_full_address.js | 16 ++++----------- test/unit/fixture/search_linguistic_bbox.js | 16 ++++----------- test/unit/fixture/search_linguistic_focus.js | 16 ++++----------- .../fixture/search_linguistic_focus_bbox.js | 16 ++++----------- .../search_linguistic_focus_null_island.js | 16 ++++----------- test/unit/fixture/search_linguistic_only.js | 16 ++++----------- .../fixture/search_linguistic_viewport.js | 20 ++++++------------- ...search_linguistic_viewport_min_diagonal.js | 20 ++++++------------- test/unit/fixture/search_partial_address.js | 16 ++++----------- test/unit/fixture/search_regions_address.js | 16 ++++----------- 18 files changed, 74 insertions(+), 210 deletions(-) diff --git a/package.json b/package.json index d44b0576..919c19c5 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "morgan": "1.7.0", "pelias-config": "^1.0.1", "pelias-logger": "^0.0.8", - "pelias-query": "^6.0.0", + "pelias-query": "^6.1.0", "pelias-suggester-pipeline": "2.0.4", "stats-lite": "1.0.3", "through2": "2.0.1" diff --git a/test/unit/fixture/autocomplete_linguistic_final_token.js b/test/unit/fixture/autocomplete_linguistic_final_token.js index 1641ac44..fbe80052 100644 --- a/test/unit/fixture/autocomplete_linguistic_final_token.js +++ b/test/unit/fixture/autocomplete_linguistic_final_token.js @@ -31,15 +31,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -60,15 +56,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 }] diff --git a/test/unit/fixture/autocomplete_linguistic_focus.js b/test/unit/fixture/autocomplete_linguistic_focus.js index 513136b9..4f722b84 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus.js +++ b/test/unit/fixture/autocomplete_linguistic_focus.js @@ -75,15 +75,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -104,15 +100,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 }] diff --git a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js index 3985d061..d9c04fd1 100644 --- a/test/unit/fixture/autocomplete_linguistic_focus_null_island.js +++ b/test/unit/fixture/autocomplete_linguistic_focus_null_island.js @@ -75,15 +75,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -104,15 +100,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 }] diff --git a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js index 16a25605..9018fdab 100644 --- a/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js +++ b/test/unit/fixture/autocomplete_linguistic_multiple_tokens.js @@ -42,15 +42,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -71,15 +67,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 }] diff --git a/test/unit/fixture/autocomplete_linguistic_only.js b/test/unit/fixture/autocomplete_linguistic_only.js index 05ff6c43..24b89ad9 100644 --- a/test/unit/fixture/autocomplete_linguistic_only.js +++ b/test/unit/fixture/autocomplete_linguistic_only.js @@ -31,15 +31,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -60,15 +56,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 }] diff --git a/test/unit/fixture/autocomplete_linguistic_with_admin.js b/test/unit/fixture/autocomplete_linguistic_with_admin.js index 2c27f670..7b2d78c3 100644 --- a/test/unit/fixture/autocomplete_linguistic_with_admin.js +++ b/test/unit/fixture/autocomplete_linguistic_with_admin.js @@ -99,18 +99,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 } ], 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - } } }, { @@ -131,18 +127,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 3 } ], 'score_mode': 'first', - 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - } + 'boost_mode': 'replace' } } ] diff --git a/test/unit/fixture/search_boundary_country.js b/test/unit/fixture/search_boundary_country.js index 5dde3344..4bf45315 100644 --- a/test/unit/fixture/search_boundary_country.js +++ b/test/unit/fixture/search_boundary_country.js @@ -49,15 +49,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -78,15 +74,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_full_address.js b/test/unit/fixture/search_full_address.js index 859cfda4..8e9fbaa8 100644 --- a/test/unit/fixture/search_full_address.js +++ b/test/unit/fixture/search_full_address.js @@ -41,15 +41,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -70,15 +66,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_bbox.js b/test/unit/fixture/search_linguistic_bbox.js index c9859aeb..5bb5907c 100644 --- a/test/unit/fixture/search_linguistic_bbox.js +++ b/test/unit/fixture/search_linguistic_bbox.js @@ -39,15 +39,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -68,15 +64,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_focus.js b/test/unit/fixture/search_linguistic_focus.js index 562f32c3..5d03d66d 100644 --- a/test/unit/fixture/search_linguistic_focus.js +++ b/test/unit/fixture/search_linguistic_focus.js @@ -69,15 +69,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -98,15 +94,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_focus_bbox.js b/test/unit/fixture/search_linguistic_focus_bbox.js index bd7c40ab..96fe92f6 100644 --- a/test/unit/fixture/search_linguistic_focus_bbox.js +++ b/test/unit/fixture/search_linguistic_focus_bbox.js @@ -69,15 +69,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -98,15 +94,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_focus_null_island.js b/test/unit/fixture/search_linguistic_focus_null_island.js index cf8b1625..0924475d 100644 --- a/test/unit/fixture/search_linguistic_focus_null_island.js +++ b/test/unit/fixture/search_linguistic_focus_null_island.js @@ -69,15 +69,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -98,15 +94,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_only.js b/test/unit/fixture/search_linguistic_only.js index 53ece28e..58c05826 100644 --- a/test/unit/fixture/search_linguistic_only.js +++ b/test/unit/fixture/search_linguistic_only.js @@ -39,15 +39,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -68,15 +64,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_linguistic_viewport.js b/test/unit/fixture/search_linguistic_viewport.js index 7cf6d138..be76ab05 100644 --- a/test/unit/fixture/search_linguistic_viewport.js +++ b/test/unit/fixture/search_linguistic_viewport.js @@ -77,18 +77,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 } ], 'score_mode': 'first', - 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - } + 'boost_mode': 'replace' } }, { @@ -109,18 +105,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 } ], 'score_mode': 'first', - 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - } + 'boost_mode': 'replace' } } ] diff --git a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js b/test/unit/fixture/search_linguistic_viewport_min_diagonal.js index c5306919..cf44d0d8 100644 --- a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js +++ b/test/unit/fixture/search_linguistic_viewport_min_diagonal.js @@ -77,18 +77,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 } ], 'score_mode': 'first', - 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - } + 'boost_mode': 'replace' } }, { @@ -109,18 +105,14 @@ module.exports = { { 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 } ], 'score_mode': 'first', - 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - } + 'boost_mode': 'replace' } } ] diff --git a/test/unit/fixture/search_partial_address.js b/test/unit/fixture/search_partial_address.js index d857e31b..6c4174b6 100644 --- a/test/unit/fixture/search_partial_address.js +++ b/test/unit/fixture/search_partial_address.js @@ -41,15 +41,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -70,15 +66,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }] diff --git a/test/unit/fixture/search_regions_address.js b/test/unit/fixture/search_regions_address.js index 25beb280..0c2ddd8f 100644 --- a/test/unit/fixture/search_regions_address.js +++ b/test/unit/fixture/search_regions_address.js @@ -41,15 +41,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'popularity' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'popularity' + 'field': 'popularity', + 'missing': 1 }, 'weight': 1 }] @@ -70,15 +66,11 @@ module.exports = { 'max_boost': 20, 'score_mode': 'first', 'boost_mode': 'replace', - 'filter': { - 'exists': { - 'field': 'population' - } - }, 'functions': [{ 'field_value_factor': { 'modifier': 'log1p', - 'field': 'population' + 'field': 'population', + 'missing': 1 }, 'weight': 2 }]