From 66d4149f6a2f1741d7cc08a53db40da4d3bf4960 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Mon, 16 Oct 2017 11:42:46 -0400 Subject: [PATCH] removed references to outdated request parameters --- .../fixture/search_linguistic_viewport.js | 71 ------------------- ...search_linguistic_viewport_min_diagonal.js | 71 ------------------- test/unit/query/search.js | 48 ------------- 3 files changed, 190 deletions(-) delete mode 100644 test/unit/fixture/search_linguistic_viewport.js delete mode 100644 test/unit/fixture/search_linguistic_viewport_min_diagonal.js diff --git a/test/unit/fixture/search_linguistic_viewport.js b/test/unit/fixture/search_linguistic_viewport.js deleted file mode 100644 index e30751ea..00000000 --- a/test/unit/fixture/search_linguistic_viewport.js +++ /dev/null @@ -1,71 +0,0 @@ -module.exports = { - 'query': { - 'function_score': { - 'query': { - 'bool': { - 'minimum_should_match': 1, - 'should': [ - { - 'bool': { - '_name': 'fallback.street', - 'boost': 5, - 'must': [ - { - 'match_phrase': { - 'address_parts.street': 'street value' - } - } - ], - 'should': [], - 'filter': { - 'term': { - 'layer': 'street' - } - } - } - } - ], - 'filter': { - 'bool': { - 'must': [ - { - 'terms': { - 'layer': [ - 'test' - ] - } - } - ] - } - } - } - }, - 'max_boost': 20, - 'functions': [ - { - 'field_value_factor': { - 'modifier': 'log1p', - 'field': 'popularity', - 'missing': 1 - }, - 'weight': 1 - }, - { - 'field_value_factor': { - 'modifier': 'log1p', - 'field': 'population', - 'missing': 1 - }, - 'weight': 2 - } - ], - 'score_mode': 'avg', - 'boost_mode': 'multiply' - } - }, - 'size': 10, - 'track_scores': true, - 'sort': [ - '_score' - ] -}; diff --git a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js b/test/unit/fixture/search_linguistic_viewport_min_diagonal.js deleted file mode 100644 index e30751ea..00000000 --- a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js +++ /dev/null @@ -1,71 +0,0 @@ -module.exports = { - 'query': { - 'function_score': { - 'query': { - 'bool': { - 'minimum_should_match': 1, - 'should': [ - { - 'bool': { - '_name': 'fallback.street', - 'boost': 5, - 'must': [ - { - 'match_phrase': { - 'address_parts.street': 'street value' - } - } - ], - 'should': [], - 'filter': { - 'term': { - 'layer': 'street' - } - } - } - } - ], - 'filter': { - 'bool': { - 'must': [ - { - 'terms': { - 'layer': [ - 'test' - ] - } - } - ] - } - } - } - }, - 'max_boost': 20, - 'functions': [ - { - 'field_value_factor': { - 'modifier': 'log1p', - 'field': 'popularity', - 'missing': 1 - }, - 'weight': 1 - }, - { - 'field_value_factor': { - 'modifier': 'log1p', - 'field': 'population', - 'missing': 1 - }, - 'weight': 2 - } - ], - 'score_mode': 'avg', - 'boost_mode': 'multiply' - } - }, - 'size': 10, - 'track_scores': true, - 'sort': [ - '_score' - ] -}; diff --git a/test/unit/query/search.js b/test/unit/query/search.js index c97fb876..ea8a4f17 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -99,54 +99,6 @@ module.exports.tests.query = function(test, common) { t.end(); }); - test('search search + viewport', function(t) { - var clean = { - parsed_text: { - street: 'street value' - }, - text: 'test', querySize: 10, - 'focus.viewport.min_lat': 28.49136, - 'focus.viewport.max_lat': 30.49136, - 'focus.viewport.min_lon': -87.50622, - 'focus.viewport.max_lon': -77.50622, - layers: ['test'] - }; - - var query = generate(clean); - - var compiled = JSON.parse( JSON.stringify( query ) ); - var expected = require('../fixture/search_linguistic_viewport'); - - t.deepEqual(compiled.type, 'fallback', 'query type set'); - t.deepEqual(compiled.body, expected, 'search_linguistic_viewport'); - t.end(); - }); - - // viewport scale sizing currently disabled. - // ref: https://github.com/pelias/api/pull/388 - test('search with viewport diagonal < 1km should set scale to 1km', function(t) { - var clean = { - parsed_text: { - street: 'street value' - }, - text: 'test', querySize: 10, - 'focus.viewport.min_lat': 28.49135, - 'focus.viewport.max_lat': 28.49137, - 'focus.viewport.min_lon': -87.50622, - 'focus.viewport.max_lon': -87.50624, - layers: ['test'] - }; - - var query = generate(clean); - - var compiled = JSON.parse( JSON.stringify( query ) ); - var expected = require('../fixture/search_linguistic_viewport_min_diagonal'); - - t.deepEqual(compiled.type, 'fallback', 'query type set'); - t.deepEqual(compiled.body, expected, 'valid search query'); - t.end(); - }); - test('search search + focus on null island', function(t) { var clean = { parsed_text: {