@alesju/sphinxapi
v1.2.2
Published
Native javascript implementation of the standard Sphinx API
Downloads
3
Readme
Sphinx Search Client for NodeJS
It's native javascript implementation of the standard Sphinx API. The API is totaly similar with the others API clients implementation. It's also respects NodeJS code convention.
This implementation is based on the Python Official Sphinx Client.
Contributors
Installation
With npm do:
$ npm install sphinxapi
Examples
Status
var SphinxClient = require ("sphinxapi"),
util = require('util'),
assert = require('assert');
var cl = new SphinxClient();
cl.SetServer('localhost', 19312);
cl.Status(function(err, result) {
assert.ifError(err);
console.log(util.inspect(result, false, null, true));
})
Query
var SphinxClient = require ("sphinxapi"),
util = require('util'),
assert = require('assert');
var cl = new SphinxClient();
cl.SetServer('localhost', 19312);
cl.Query('test', function(err, result) {
assert.ifError(err);
console.log(util.inspect(result, false, null, true));
});
API Documentation
from the official documentation : http://sphinxsearch.com/docs/current.html#api-reference
GetLastError()
GetLastWarning()
SetServer (host, port)
SetConnectTimeout (timeout)
SetLimits (offset, limit, maxmatches, cutoff)
SetMaxQueryTime (maxquerytime)
SetMatchMode (mode)
SetRankingMode (ranker, rankexpr)
SetSortMode (mode, clause)
SetWeights (weights)
SetFieldWeights (weights)
SetIndexWeights (weights)
SetIDRange (minid, maxid)
SetFilter (attribute, values, exclude)
SetFilterRange (attribute, min, max, exclude)
SetGeoAnchor (attrlat, attrlong, latitude, longitude)
SetGroupBy (attribute, func, groupsort )
SetGroupDistinct (attribute)
SetRetries (count, delay)
SetOverride (name, type, values)
SetSelect (select)
ResetOverrides ()
ResetFilters ()
ResetGroupBy ()
Query (query, index, comment, fn)
AddQuery (query, index, comment)
RunQueries (fn)
BuildExcerpts (docs, index, words, opts)
UpdateAttributes (index, attrs, values, mva)
BuildKeywords (query, index, hits )
Status (fn)
Open ()
Close ()
EscapeString (string)
FlushAttributes ()
Also
- https://github.com/kurokikaze/limestone