-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05c60c1
commit 798484e
Showing
2 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
var limestone = require("./limestone").SphinxClient(); | ||
|
||
var testString = 'test'; | ||
|
||
// 9312 is standard Sphinx port | ||
limestone.connect(9312, function(err) { | ||
if (err) { | ||
console.log('Connection error: ' + err); | ||
console.log('Connection error: ' + err.message); | ||
console.log('Maybe Sphinx is not started or uses port different than 9312'); | ||
process.exit(); | ||
} | ||
console.log('Connected, sending query'); | ||
limestone.query({'query':'test', maxmatches:1, 'fieldweights': {'name': 80, 'body': 30}}, function(err, answer) { | ||
limestone.query({'query':testString, maxmatches:1, 'fieldweights': {'name': 80, 'body': 30}}, function(err, answer) { | ||
limestone.disconnect(); | ||
console.log("Extended search for 'test' yielded " + answer.match_count + " results: " + JSON.stringify(answer)); | ||
console.log("Extended search for '" + testString + "' yielded " + answer.match_count + " results: " + JSON.stringify(answer)); | ||
}); | ||
}); | ||
}); |