Browse Source

5/3/1 precisions for suggest that start with a number or if more than 3 characters. if its less than 3 characters give preference to admins

msv2
Harish Krishna 10 years ago
parent
commit
b6b0c80f30
  1. 12
      controller/suggest.js

12
controller/suggest.js

@ -57,10 +57,10 @@ function setup( backend, query ){
var async_query; var async_query;
if (req.clean.input.length < 4) { if (req.clean.input.length < 4 && isNaN(parseInt(req.clean.input, 10))) {
async_query = { async_query = {
a: function(callback){ a: function(callback){
cmd.body = query_admin( req.clean, 4 ); cmd.body = query_admin( req.clean, 3 );
query_backend(cmd, callback); query_backend(cmd, callback);
}, },
b: function(callback) { b: function(callback) {
@ -75,14 +75,18 @@ function setup( backend, query ){
} else { } else {
async_query = { async_query = {
a: function(callback){ a: function(callback){
cmd.body = query_poi( req.clean ); cmd.body = query_poi( req.clean, 5);
query_backend(cmd, callback); query_backend(cmd, callback);
}, },
b: function(callback){ b: function(callback){
cmd.body = query_admin( req.clean ); cmd.body = query_poi( req.clean, 3);
query_backend(cmd, callback); query_backend(cmd, callback);
}, },
c: function(callback){ c: function(callback){
cmd.body = query_admin( req.clean );
query_backend(cmd, callback);
},
d: function(callback){
cmd.body = query_poi( req.clean, 1 ); cmd.body = query_poi( req.clean, 1 );
query_backend(cmd, callback); query_backend(cmd, callback);
} }

Loading…
Cancel
Save