diff --git a/controller/suggest.js b/controller/suggest.js index 425b7415..8069d8a3 100644 --- a/controller/suggest.js +++ b/controller/suggest.js @@ -96,6 +96,15 @@ function setup( backend, query ){ } } + // fuzzy + async_query.fuzzy = function(callback){ + cmd.body = query( req.clean ); + cmd.body.pelias.completion.fuzzy = { + 'fuzziness': 2 + }; + query_backend(cmd, callback); + } + async.parallel(async_query, function(err, results) { // results is equal to: {a: docs, b: docs, c: docs} var splice_length = parseInt((SIZE / Object.keys(results).length), 10); diff --git a/query/suggest.js b/query/suggest.js index e936230a..29f2f0b3 100644 --- a/query/suggest.js +++ b/query/suggest.js @@ -25,9 +25,6 @@ function generate( params, precision ){ 'completion' : { 'size' : params.size, 'field' : 'suggest', - 'fuzzy' : { - 'fuzziness' : 2 - }, 'context': { 'dataset': params.layers, 'location': {