|
|
@ -68,7 +68,7 @@ function setup( backend, query ){ |
|
|
|
return { |
|
|
|
return { |
|
|
|
_index: 'pelias', |
|
|
|
_index: 'pelias', |
|
|
|
_type: idParts[0], |
|
|
|
_type: idParts[0], |
|
|
|
_id: idParts[1] |
|
|
|
_id: idParts.slice(1).join(':') |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ function setup( backend, query ){ |
|
|
|
|
|
|
|
|
|
|
|
// admin only
|
|
|
|
// admin only
|
|
|
|
req.admin = {}; |
|
|
|
req.admin = {}; |
|
|
|
for (k in req.clean) { req.admin[k] = req.clean[k] } |
|
|
|
for (var k in req.clean) { req.admin[k] = req.clean[k]; } |
|
|
|
req.admin.layers = ['admin0','admin1','admin2']; |
|
|
|
req.admin.layers = ['admin0','admin1','admin2']; |
|
|
|
|
|
|
|
|
|
|
|
if (req.clean.input.length < 4 && isNaN(parseInt(req.clean.input, 10))) { |
|
|
|
if (req.clean.input.length < 4 && isNaN(parseInt(req.clean.input, 10))) { |
|
|
@ -106,7 +106,7 @@ function setup( backend, query ){ |
|
|
|
cmd.body = query( req.clean, 3 ); |
|
|
|
cmd.body = query( req.clean, 3 ); |
|
|
|
query_backend(cmd, callback); |
|
|
|
query_backend(cmd, callback); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
async_query = { |
|
|
|
async_query = { |
|
|
|
all_5p: function(callback){ |
|
|
|
all_5p: function(callback){ |
|
|
@ -125,7 +125,7 @@ function setup( backend, query ){ |
|
|
|
cmd.body = query( req.admin ); |
|
|
|
cmd.body = query( req.admin ); |
|
|
|
query_backend(cmd, callback); |
|
|
|
query_backend(cmd, callback); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async.parallel(async_query, function(err, results) { |
|
|
|
async.parallel(async_query, function(err, results) { |
|
|
|