make user weight a float, not int

This commit is contained in:
Matt
2014-11-17 14:46:31 -08:00
parent 702785a8ee
commit 994dc02d62
2 changed files with 7 additions and 6 deletions

@ -2029,6 +2029,7 @@ bool Query::setQWords ( char boolFlag ,
qw->m_opcode = OP_PIPE;
continue;
}
// [133.0r]
// is it the bracket operator?
// " LeFtB 113 rp RiGhB "
if ( wlen == 5 &&
@ -2055,16 +2056,16 @@ bool Query::setQWords ( char boolFlag ,
continue;
}
// get the number
long val = atol2 (s, slen);
float fval = atof2 (s, slen);
// s2 MUST point to the a,r,ap,rp string
char *s2 = words.getWord(i+4);
// is it a phrase?
if ( s2[1] == 'p' ) {
userWeightPhrase = val;
userWeightPhrase = fval;
userTypePhrase = s2[0]; // a or r
}
else {
userWeight = val;
userWeight = fval;
userType = s2[0]; // a or r
}
// ignore all following words up and inc. i+6

@ -356,9 +356,9 @@ class QueryWord {
// . used by QueryBoolean since it uses QueryWords heavily
class QueryTerm *m_queryWordTerm;
// user defined weights
long m_userWeight;
float m_userWeight;
char m_userType;
long m_userWeightPhrase;
float m_userWeightPhrase;
char m_userTypePhrase;
bool m_queryOp;
// is it after a NOT operator? i.e. NOT ( x UOR y UOR ... )
@ -469,7 +469,7 @@ class QueryTerm {
// is it a repeat?
char m_repeat;
// user defined weight for this term, be it phrase or word
long m_userWeight;
float m_userWeight;
char m_userType;
// . is this query term before a | (pipe) operator?
// . if so we must read the whole termlist, like m_underNOT above