You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
583 B

10 years ago
var logger = require('../src/logger');
// Build pelias suggest query
function generate( params, precision ){
10 years ago
var cmd = {
'pelias' : {
'text' : params.input,
'completion' : {
'size' : params.size,
'field' : 'suggest',
'context': {
'dataset': ['admin0','admin1','admin2'],
'location': {
'value': [ params.lon, params.lat ],
'precision': precision || 1
10 years ago
}
}
}
}
};
// logger.log( 'cmd', JSON.stringify( cmd, null, 2 ) );
return cmd;
}
module.exports = generate;