Skip to content
kurokikaze edited this page Sep 13, 2010 · 5 revisions

Usage is simple. Limestone is an ordinary module.

var limestone = require("./limestone"),
    sys = require("sys");

// 9312 is standard Sphinx port
limestone.connect(9312, function() {
    limestone.query('test', function(answer){
        sys.puts("Search for ‘test’ yielded " + answer.match_count + " results: " + JSON.stringify(answer));
        limestone.disconnect();
    });
});

Usage with parameters:

var limestone = require("./limestone"),
    sys = require("sys");

// 9312 is standard Sphinx port
limestone.connect(9312, function() {
    limestone.query({query:'test', maxmatches:1, comment:'Testing limestone'}, function(answer){
        sys.puts("Search for ‘test’ yielded " + answer.match_count + " results: " + JSON.stringify(answer));
        limestone.disconnect();
    });
});

This will perform query with maximum of one match, leaving comment ‘Testing limestone’.

Clone this wiki locally