Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #5 from johnmarkg/master
Browse files Browse the repository at this point in the history
RunQueries sometimes doesn't return results for all queries.
  • Loading branch information
touv committed May 6, 2013
2 parents e80c74e + 1839484 commit d5a43ac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/sphinxapi.js
Expand Up @@ -748,17 +748,17 @@ SphinxClient.prototype.RunQueries = function (fn) {
}

var match = { 'id':doc, 'weight':weight, 'attrs':{} }
for (var i = 0; i < result['attrs'].length; i++) {
var attr0 = attrs[i][0]
if (attrs[i][1] == SphinxClient.SPH_ATTR_FLOAT) {
for (var j = 0; < result['attrs'].length; j++) {
var attr0 = attrs[j][0]
if (attrs[j][1] == SphinxClient.SPH_ATTR_FLOAT) {
match['attrs'][attr0] = Number(unpack('>f', response.slice(p, p + 4)))
}
else if (attrs[i][1] == SphinxClient.SPH_ATTR_BIGINT) {
else if (attrs[j][1] == SphinxClient.SPH_ATTR_BIGINT) {
// match['attrs'][attr0] = Number(unpack('>q', response.slice(p, p + 8)))
match['attrs'][attr0] = Number(unpackInt64(response.slice(p, p + 8)))
p += 4
}
else if (attrs[i][1] == SphinxClient.SPH_ATTR_STRING) {
else if (attrs[j][1] == SphinxClient.SPH_ATTR_STRING) {
var slen = Number(unpack('>L', response.slice(p, p + 4)))
p += 4
match['attrs'][attr0] = ''
Expand All @@ -767,7 +767,7 @@ SphinxClient.prototype.RunQueries = function (fn) {
}
p += slen-4
}
else if (attrs[i][1] == SphinxClient.SPH_ATTR_MULTI) {
else if (attrs[j][1] == SphinxClient.SPH_ATTR_MULTI) {
match['attrs'][attr0] = []
var nvals = Number(unpack('>L', response.slice(p, p + 4)))
p += 4
Expand All @@ -777,7 +777,7 @@ SphinxClient.prototype.RunQueries = function (fn) {
}
p -= 4
}
else if (attrs[i][1] == SphinxClient.SPH_ATTR_MULTI64) {
else if (attrs[j][1] == SphinxClient.SPH_ATTR_MULTI64) {
match['attrs'][attr0] = []
nvals = Number(unpack('>L', response.slice(p, p + 4)))
nvals = nvals/2
Expand Down

0 comments on commit d5a43ac

Please sign in to comment.