I have been trying to fetch sphinx data using Node.js and limestone. I got everything from sphinx instead the float value. In my Sphinx index Height is defined as float value ("sql_attr_float = Height") and but the Node.js returning some integer value.
Eg: if Height value in sphinx is 172.72, then i got "1127004242" from the Node.js
Please help me on this.
Below is the function used in limestone file which reads sphinx data,
proto.toReader = function toReader() {
var offset = 0, length = this.length, buffer = this;
return {
empty: function empty() {
return offset >= length;
},
int64: function shiftInt64() {
var hi_low_pair = buffer.int64Read(offset);
offset += 8;
return hi_low_pair;
},
int32: function shiftInt32() {
var number = buffer.int32Read(offset);
offset += 4;
return number;
},
int16: function shiftInt16() {
var number = buffer.int16Read(offset);
offset += 2;
return number;
},
buffer: function shiftBuffer(length) {
var b = buffer.slice(offset, offset + length);
offset += length;
return b;
},
string: function shiftString(length) {
var string = buffer.toString('utf8', offset, offset + length);
offset += length;
return string;
},
cstring: function shiftCstring() {
var end = offset;
while (buffer[end] > 0 && end < length) { end++; }
var string = buffer.toString('utf8', offset, end);
offset = end + 1;
return string;
},
lstring: function shiftLString() {
var length = buffer.int32Read(offset);
offset += 4;
if(!isNaN(length) && !isNaN(offset)){
length = length;
var string = buffer.toString('utf8', offset, offset + length);
}else{
var string = "";
}
offset += length;
return string;
},
multicstring: function shiftMulticstring() {
var fields = [];
while (buffer[offset] > 0) {
fields.push(this.cstring());
}
offset++;
return fields;
},
hash: function shiftHash() {
var hash = {};
while (buffer[offset] > 0) {
hash[this.cstring()] = this.cstring();
}
offset++;
return hash;
}
};
};