Skip to content

Native javascript implementation of the standard Sphinx API

License

Notifications You must be signed in to change notification settings

carstenschwede/node-sphinxapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

Porting Status GetLastError()

Porting Status GetLastWarning()

Porting Status SetServer (host, port)

Porting Status SetConnectTimeout (timeout)

Porting Status SetLimits (offset, limit, maxmatches, cutoff)

Porting Status SetMaxQueryTime (maxquerytime)

Porting Status SetMatchMode (mode)

Porting Status SetRankingMode (ranker, rankexpr)

Porting Status SetSortMode (mode, clause)

Porting Status SetWeights (weights)

Porting Status SetFieldWeights (weights)

Porting Status SetIndexWeights (weights)

Porting Status SetIDRange (minid, maxid)

Porting Status SetFilter (attribute, values, exclude)

Porting Status SetGeoAnchor (attrlat, attrlong, latitude, longitude)

Porting Status SetGroupBy (attribute, func, groupsort )

Porting Status SetGroupDistinct (attribute)

Porting Status SetRetries (count, delay)

Porting Status SetOverride (name, type, values)

Porting Status SetSelect (select)

Porting Status ResetOverrides ()

Porting Status ResetFilters ()

Porting Status ResetGroupBy ()

Porting Status Query (query, index, comment, fn)

Porting Status AddQuery (query, index, comment)

Porting Status RunQueries (fn)

Porting Status BuildExcerpts (docs, index, words, opts)

Porting Status UpdateAttributes (index, attrs, values, mva)

Porting Status BuildKeywords (query, index, hits )

Porting Status Status (fn)

Porting Status Open ()

Porting Status Close ()

Porting Status EscapeString (string)

Porting Status FlushAttributes ()

Also

License

MIT/X11

About

Native javascript implementation of the standard Sphinx API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.9%
  • Shell 1.1%