Permalink
Browse files

Updated from sys.puts to console.log everywhere, fixed broken symbols…

… in test script messages
  • Loading branch information...
1 parent 6e8d597 commit 4511487af9703916da3c523f412935fa42f7befc @kurokikaze kurokikaze committed Oct 10, 2011
Showing with 15 additions and 19 deletions.
  1. +6 −7 limestone.js
  2. +1 −2 ls-test.js
  3. +3 −4 purels-opt.js
  4. +5 −6 purels.js
View
@@ -1,5 +1,4 @@
var tcp = require('net');
-var sys = require('util');
exports.SphinxClient = function() {
var self = { };
@@ -135,17 +134,17 @@ exports.SphinxClient = function() {
server_conn.addListener('connect', function () {
- //sys.puts('Connected, sending protocol version... State is ' + server_conn.readyState);
+ // console.log('Connected, sending protocol version... State is ' + server_conn.readyState);
// Sending protocol version
- // sys.puts('Sending version number...');
+ // console.log('Sending version number...');
// Here we must send 4 bytes, '0x00000001'
if (server_conn.readyState == 'open') {
var version_number = Buffer.makeWriter();
version_number.push.int32(1);
// Waiting for answer
server_conn.once('data', function(data) {
/*if (response_output) {
- sys.puts('connect: Data received from server');
+ console.log('connect: Data received from server');
}*/
var protocol_version_raw = data.toReader();
@@ -195,7 +194,7 @@ exports.SphinxClient = function() {
};
- // sys.puts('Connecting to searchd...');
+ // console.log('Connecting to searchd...');
self.query = function(query_raw, callback) {
var query = new Object();
@@ -253,7 +252,7 @@ exports.SphinxClient = function() {
}
/* if (connection_status != 1) {
- sys.puts("You must connect to server before issuing queries");
+ console.log("You must connect to server before issuing queries");
return false;
} */
@@ -518,7 +517,7 @@ exports.SphinxClient = function() {
},
append : function(data) {
//this.data.write(data.toString('utf-8'), 'utf-8');
- // sys.puts('Appending ' + data.length + ' bytes');
+ // console.log('Appending ' + data.length + ' bytes');
var new_buffer = new Buffer(this.data.length + data.length);
this.data.copy(new_buffer, 0, 0);
data.copy(new_buffer, this.data.length, 0);
View
@@ -1,5 +1,4 @@
-var sys = require("sys"),
- http = require("http"),
+var http = require("http"),
limestone = require("./limestone").SphinxClient();
http.createServer(function (request, response) {
View
@@ -1,14 +1,13 @@
-var limestone = require("./limestone").SphinxClient(),
- sys = require("sys");
+var limestone = require("./limestone").SphinxClient();
// 9312 is standard Sphinx port
limestone.connect(9312, function(err) {
if (!err) {
limestone.query({'query':'test', indices:'*'}, function(err, answer){
if (!err) {
- sys.puts("Extended search for test yielded " + answer.match_count + " results: " + JSON.stringify(answer));
+ console.log("Extended search for 'test' yielded " + answer.match_count + " results: " + JSON.stringify(answer));
limestone.disconnect();
}
});
}
-});
+});
View
@@ -1,14 +1,13 @@
-var limestone = require("./limestone").SphinxClient(),
- sys = require("sys");
+var limestone = require("./limestone").SphinxClient();
// 9312 is standard Sphinx port
limestone.connect(9312, function(err) {
if (err) {
- sys.puts('Connection error: ' + err);
+ console.log('Connection error: ' + err);
}
- sys.puts('Connected, sending query');
- limestone.query({'query':'test', maxmatches:1}, function(err, answer) {
+ console.log('Connected, sending query');
+ limestone.query({'query':'test', maxmatches:1, 'fieldweights': {'name': 80, 'body': 30}}, function(err, answer) {
limestone.disconnect();
- sys.puts("Extended search for �test’ yielded " + answer.match_count + " results: " + JSON.stringify(answer));
+ console.log("Extended search for 'test' yielded " + answer.match_count + " results: " + JSON.stringify(answer));
});
});

0 comments on commit 4511487

Please sign in to comment.