Skip to content

Commit

Permalink
Sys.puts, really?
Browse files Browse the repository at this point in the history
  • Loading branch information
kurokikaze committed Feb 19, 2014
1 parent 3f188ea commit 76ee695
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
Usage:

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

limestone.connect(9312, // port. 9312 is standard Sphinx port. also 'host:port' allowed
function(err) { // callback
if (err) {
sys.puts('Connection error: ' + err);
console.log('Connection error: ' + err.message);
process.exit();
}
sys.puts('Connected, sending query');
console.log('Connected, sending query');
limestone.query(
{'query':'test', maxmatches:1},
function(err, answer) {
limestone.disconnect();
sys.puts("Extended search for 'test' yielded " +
console.log("Extended search for 'test' yielded " +
answer.match_count + " results: " +
JSON.stringify(answer));
});
Expand All @@ -26,9 +26,9 @@ To Use Build_Excerpts:
limestone.connect(9312, // port
function(err) { //callback
if (err) {
sys.puts('Connection error: ' + err);
console.log('Connection error: ' + err);
}
sys.puts('Connected Build Excerpts');
console.log('Connected Build Excerpts');
limestone.build_excerpts(
['this is my teste text to be highlighted',
'this is another test text to be highlighted'], // docs
Expand All @@ -37,7 +37,7 @@ To Use Build_Excerpts:
{},
function(err, answer) {
limestone.disconnect();
sys.puts(JSON.stringify(answer));
console.log(JSON.stringify(answer));
}
);
});
Expand All @@ -49,16 +49,16 @@ You can ask sphinx to open a persistent connection. You can then make several re
true, // persistent (optional)
function(err) { // callback
if (err){
sys.puts('Connection error: ' + err);
console.log('Connection error: ' + err);
}
sys.puts('Connected Search');
sys.puts('sending query');
console.log('Connected Search');
console.log('sending query');
limestone.query(
{'query':'test', // query obj with sphinx opts
maxmatches:1,
indexes:'questions_1,products_3'},
function(err, answer){ // callback
sys.puts('Extended search yielded ' +
console.log('Extended search yielded ' +
answer.match_count + " results\n" +
JSON.stringify(answer));
Expand All @@ -70,7 +70,7 @@ You can ask sphinx to open a persistent connection. You can then make several re
{},
function(err, answer){
limestone.disconnect();
sys.puts(JSON.stringify(answer));
console.log(JSON.stringify(answer));
}
);
Expand Down

0 comments on commit 76ee695

Please sign in to comment.