From b51db53213a1721911528a0d4bff84c5fdab517c Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Tue, 7 Apr 2015 11:43:57 -0400 Subject: [PATCH 1/3] using an optimized bbox query --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a541a0b..65ee7691 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": "git://github.com/geopipes/elasticsearch-backend#bbox-optimize", "pelias-suggester-pipeline": "2.0.2", "is-object": "^1.0.1", "pelias-esclient": "0.0.25" From f13f1cdf2cc4cc2fa6fcd95e22026b0ec6792d3b Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Tue, 7 Apr 2015 14:40:38 -0400 Subject: [PATCH 2/3] tests --- test/unit/query/search.js | 112 +++++++++++++------------------------- 1 file changed, 38 insertions(+), 74 deletions(-) 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(); From 94b044d17904cba5e8015f26f8f52a8697da0963 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Wed, 8 Apr 2015 16:39:50 -0400 Subject: [PATCH 3/3] using elasticsearch-backend 0.0.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65ee7691..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": "git://github.com/geopipes/elasticsearch-backend#bbox-optimize", + "geopipes-elasticsearch-backend": "0.0.12", "pelias-suggester-pipeline": "2.0.2", "is-object": "^1.0.1", "pelias-esclient": "0.0.25"