From d80008d098056cd9a1d752f0655199e6a0a8a996 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 20 May 2015 15:43:10 +0200 Subject: [PATCH] pedantry: fix indentation and code comment --- query/search.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/query/search.js b/query/search.js index d93a5982..e1cb33b0 100644 --- a/query/search.js +++ b/query/search.js @@ -18,19 +18,18 @@ function generate( params ){ query = queries.bbox ( centroid, { size: params.size, bbox: params.bbox } ); } - // add search condition to distance query + // add search condition to filtered query query.query.filtered.query = { 'bool': { 'must': [{ - 'multi_match': { - 'query': params.input, - 'fields': [ 'name.*' ] - } + 'multi_match': { + 'query': params.input, + 'fields': [ 'name.*' ] } - ] + }] } }; - + if (params.input_admin) { var admin_fields = ['admin0', 'admin1', 'admin1_abbr', 'admin2', 'alpha3']; query.query.filtered.query.bool.should = []; @@ -39,7 +38,7 @@ function generate( params ){ var match = {}; match[admin_field] = params.input_admin; query.query.filtered.query.bool.should.push({ - 'match': match + 'match': match }); }); }