Browse Source

introducing fuzziness in suggest queries as a mixin and not for all queries (because that results in an overkill) (this is a test)

fuzzy
Harish Krishna 10 years ago
parent
commit
f789b1e6e5
  1. 9
      controller/suggest.js
  2. 3
      query/suggest.js

9
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);

3
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': {

Loading…
Cancel
Save