diff --git a/package.json b/package.json index 7a541a0b..57ddf4cb 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "express": "^4.8.8", "geojson": "^0.2.0", "geojson-extent": "^0.3.1", - "geopipes-elasticsearch-backend": "0.0.11", + "geopipes-elasticsearch-backend": "0.0.12", "pelias-suggester-pipeline": "2.0.2", "is-object": "^1.0.1", "pelias-esclient": "0.0.25" diff --git a/test/unit/query/search.js b/test/unit/query/search.js index 1e5301e3..82a23239 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -49,6 +49,44 @@ var sort = [ } ]; +var expected = { + 'query': { + 'filtered': { + 'query': { + 'bool': { + 'must': [{ + 'match': { + 'name.default': 'test' + } + } + ] + } + }, + 'filter': { + 'bool': { + 'must': [ + { + 'geo_bounding_box': { + 'center_point': { + 'top': '47.47', + 'right': '-61.84', + 'bottom':'11.51', + 'left': '-103.16' + }, + '_cache': true, + 'type': 'indexed' + } + } + ] + } + } + } + }, + 'sort': sort, + 'size': 10, + 'track_scores': true +}; + module.exports.tests.query = function(test, common) { test('valid query', function(t) { var query = generate({ @@ -63,43 +101,6 @@ module.exports.tests.query = function(test, common) { layers: ['test'] }); - var expected = { - 'query': { - 'filtered': { - 'query': { - 'bool': { - 'must': [{ - 'match': { - 'name.default': 'test' - } - } - ] - } - }, - 'filter': { - 'bool': { - 'must': [ - { - 'geo_bounding_box': { - 'center_point': { - 'top': '47.47', - 'right': '-61.84', - 'bottom':'11.51', - 'left': '-103.16' - }, - '_cache': true - } - } - ] - } - } - } - }, - 'sort': sort, - 'size': 10, - 'track_scores': true - }; - t.deepEqual(query, expected, 'valid search query'); t.end(); }); @@ -115,43 +116,6 @@ module.exports.tests.query = function(test, common) { }, layers: ['test'] }); - - var expected = { - 'query': { - 'filtered': { - 'query': { - 'bool': { - 'must': [{ - 'match': { - 'name.default': 'test' - } - } - ] - } - }, - 'filter': { - 'bool': { - 'must': [ - { - 'geo_bounding_box': { - 'center_point': { - 'top': '47.47', - 'right': '-61.84', - 'bottom':'11.51', - 'left': '-103.16' - }, - '_cache': true - } - } - ] - } - } - } - }, - 'sort': sort, - 'size': 10, - 'track_scores': true - }; t.deepEqual(query, expected, 'valid search query'); t.end();