Browse Source

pedantry: fix indentation and code comment

pull/140/head
Peter Johnson 10 years ago
parent
commit
d80008d098
  1. 15
      query/search.js

15
query/search.js

@ -18,19 +18,18 @@ function generate( params ){
query = queries.bbox ( centroid, { size: params.size, bbox: params.bbox } ); 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 = { query.query.filtered.query = {
'bool': { 'bool': {
'must': [{ 'must': [{
'multi_match': { 'multi_match': {
'query': params.input, 'query': params.input,
'fields': [ 'name.*' ] 'fields': [ 'name.*' ]
}
} }
] }]
} }
}; };
if (params.input_admin) { if (params.input_admin) {
var admin_fields = ['admin0', 'admin1', 'admin1_abbr', 'admin2', 'alpha3']; var admin_fields = ['admin0', 'admin1', 'admin1_abbr', 'admin2', 'alpha3'];
query.query.filtered.query.bool.should = []; query.query.filtered.query.bool.should = [];
@ -39,7 +38,7 @@ function generate( params ){
var match = {}; var match = {};
match[admin_field] = params.input_admin; match[admin_field] = params.input_admin;
query.query.filtered.query.bool.should.push({ query.query.filtered.query.bool.should.push({
'match': match 'match': match
}); });
}); });
} }

Loading…
Cancel
Save