mirror of https://github.com/pelias/api.git
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
559 B
29 lines
559 B
10 years ago
|
|
||
|
var logger = require('../src/logger');
|
||
|
|
||
|
// Build pelias suggest query
|
||
|
function generate( params ){
|
||
|
|
||
|
var cmd = {
|
||
|
'pelias' : {
|
||
|
'text' : params.input,
|
||
|
'completion' : {
|
||
|
'size' : params.size,
|
||
|
'field' : 'suggest',
|
||
|
'context': {
|
||
|
'dataset': ['admin0','admin1','admin2'],
|
||
|
'location': {
|
||
|
'value': [ params.lon, params.lat ],
|
||
|
'precision': 1
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// logger.log( 'cmd', JSON.stringify( cmd, null, 2 ) );
|
||
|
return cmd;
|
||
|
|
||
|
}
|
||
|
|
||
|
module.exports = generate;
|