more bool fixes. still needs a little more work

This commit is contained in:
mwells
2014-03-13 13:54:23 -07:00
parent 3b2d981dff
commit 7812f5c746
7 changed files with 16 additions and 29 deletions

@ -1324,7 +1324,7 @@ bool printSearchResultsHeader ( State0 *st ) {
if ( isAdmin ) {
sb->safePrintf("   "
"<font color=red><b>"
"<a href=\"/admin/basic?c=%s\">"
"<a href=\"/admin/settings?c=%s\">"
"[admin]"
"</a></b></font>",coll);
// print reindex link

@ -10699,7 +10699,7 @@ void Parms::init ( ) {
m->m_off = (char *)&cr.m_siteClusterByDefault - x;
m->m_soff = (char *)&si.m_doSiteClustering - y;
m->m_type = TYPE_BOOL;
m->m_def = "1";
m->m_def = "0";
m->m_sparm = 1;
m->m_scgi = "sc";
m++;

@ -4492,7 +4492,7 @@ bool PosdbTable::setQueryTermInfo ( ) {
// the bit vector in a truth table
long maxSlots = maxDocIds * 2;
// get total operands we used
long numOperands = m_q->m_operatorCount + 1;
long numOperands = m_q->m_numOperands;
// a quoted phrase counts as a single operand
m_vecSize = numOperands / 8 ;
// allow an extra byte for remainders

@ -41,7 +41,6 @@ Query::~Query ( ) {
}
void Query::reset ( ) {
m_operatorCount = 0;
m_docIdRestriction = 0LL;
m_groupThatHasDocId = NULL;
m_bufLen = 0;
@ -150,7 +149,7 @@ bool Query::set2 ( char *query ,
char *q = query;
// see if it should be boolean...
for ( long i = 0 ; boolFlag && i < queryLen ; i++ ) {
for ( long i = 0 ; i < queryLen ; i++ ) {
if ( q[i]=='A' && q[i+1]=='N' && q[i+2]=='D' &&
(q[i+3]==' ' || q[i+3]=='(') )
boolFlag = 1;
@ -3322,7 +3321,7 @@ void Query::printBooleanTree(){
Expression *e = &m_expressions [ 0 ];
// find top-level expression
while (e->m_parent && e != e->m_parent) e = e->m_parent;
SafeBuf sbuf(1024);
SafeBuf sbuf(1024,"botree");
e->print(&sbuf);
logf(LOG_DEBUG, "query: Boolean Query: %s", sbuf.getBufStart());
}
@ -3483,7 +3482,7 @@ long Operand::set ( long a , long b , QueryWord *qwords , long level ,
//if (qw->m_phraseSign == '+') m_hardRequiredBits |= e;
//m_termBits |= e;
long byte = qw->m_opNum / 8;
long mask = qw->m_opNum % 8;
long mask = 1<<(qw->m_opNum % 8);
if ( byte < MAX_OVEC_SIZE ) m_opBits[byte] |= mask;
}
// why would it be ignored? oh... if like cd-rom or in quotes
@ -3496,7 +3495,7 @@ long Operand::set ( long a , long b , QueryWord *qwords , long level ,
//if (qw->m_phraseSign == '+') m_hardRequiredBits |= e;
//m_termBits |= e;
long byte = qw->m_opNum / 8;
long mask = qw->m_opNum % 8;
long mask = 1<<(qw->m_opNum % 8);
if ( byte < MAX_OVEC_SIZE ) m_opBits[byte] |= mask;
}
}
@ -3575,10 +3574,6 @@ long Expression::set (long start,
// set this
qw->m_underNOT = underNOT;
// count TOTAL operators so we can separate operands
// when assigning Operand::m_opNum
q->m_operatorCount++;
// set leaf node if not an opcode like "AND" and not punct.
if (!qw->m_opcode && qw->isAlphaWord()){
// if this is NOT the very first word of the expression
@ -3588,20 +3583,6 @@ long Expression::set (long start,
Operand *op = &o_operands [ *o_numOperands ];
*o_numOperands = *o_numOperands + 1;
// undo the above count since we are a true operand
// and not an operator or ( or )
q->m_operatorCount--;
// this tells us what bit # to set when making
// the operand bit vector for a docid and calling
// Expression::isTruth()
if ( qw->m_queryPhraseTerm )
qw->m_queryPhraseTerm->m_opNum =
q->m_operatorCount;
if ( qw->m_queryWordTerm )
qw->m_queryWordTerm->m_opNum =
q->m_operatorCount;
// . return ptr to next word for us to parse
// . subtract once since for loop will inc it
i = op->set ( i , end , qwords , level , underNOT );

@ -881,7 +881,6 @@ class Query {
long m_synTerm; // first term that's a synonym
class SynonymInfo *m_synInfo;
long m_synInfoAllocSize;
long m_operatorCount;
// if they got a gbdocid: in the query and it's not boolean, set these
long long m_docIdRestriction;

@ -9907,7 +9907,8 @@ long getUrlFilterNum2 ( SpiderRequest *sreq ,
char *row;
bool checkedRow = false;
SpiderColl *sc = cr->m_spiderColl;
//SpiderColl *sc = cr->m_spiderColl;
SpiderColl *sc = g_spiderCache.getSpiderColl(cr->m_collnum);
//if ( strstr(url,"http://www.vault.com/rankings-reviews/company-rankings/law/vault-law-100/.aspx?pg=2" ))
// log("hey");

@ -144,7 +144,13 @@
# Sends to email address 1 through email server 1 if any parm is changed.
<sendParmChangeEmailAlertsToEmail1>0</>
# Connects to this server directly when sending email 1
# Connects to this IP or hostname directly when sending email 1. Use
# <i>apt-get install sendmail</i> to install sendmail on that IP or hostname.
# Add <i>From:10.5 RELAY</i> to /etc/mail/access to allow sendmail to forward
# email it receives from gigablast if gigablast hosts are on the 10.5.*.* IPs.
# Then run <i>/etc/init.d/sendmail restart</i> as root to pick up those
# changes so sendmail will forward Gigablast's mail to the address you give
# below.
<emailServer1><![CDATA[10.5.54.47]]></>
# Sends to this address when sending email 1