index.js
function (db, index, term, field, cb) {
			var url = host +
				'databases/' + db +
				'/suggest/' + index +
				'?term=' + encodeURIComponent(term) +
				'&field=' + field +
				'&max=10&distance=Default&accuracy=0.5';
			request(url, function (error, response, body) {
				if (!error && response.statusCode === 200) {
					var result = JSON.parse(body);
					cb(null, result);
				}
				else {
					cb(error || new Error(response.statusCode), null);
				}
			});
		}
function (db, index, term, field, cb) {
			var url = host +
				'databases/' + db +
				'/suggest/' + index +
				'?term=' + encodeURIComponent(term) +
				'&field=' + field +
				'&max=10&distance=Default&accuracy=0.5';
			request(url, function (error, response, body) {
				if (!error && response.statusCode === 200) {
					var result = JSON.parse(body);
					cb(null, result);
				}
				else {
					cb(error || new Error(response.statusCode), null);
				}
			});
		}
function ( db , index , term , field , cb ) { var url = host + 'databases/' + db + '/suggest/' + index + '?term=' + encodeURIComponent ( term ) + '&field=' + field + '&max=10&distance=Default&accuracy=0.5' ; request ( url , function ( error , response , body ) { if ( ! error && response . statusCode === 200 ) { var result = JSON . parse ( body ) ; cb ( null , result ) ; } else { cb ( error || new Error ( response . statusCode ) , null ) ; } } ) ; }
Returns Suggestions for given query and fieldName.
@param {string} db
@param {string} index
@param {string} term
@param {string} field
@param {Function} cb
Returns Suggestions for given query and fieldName .