fix facet bug

This commit is contained in:
Matt 2014-12-11 13:13:50 -08:00
parent a0e887467e
commit c8f305468f
4 changed files with 10 additions and 5 deletions

@ -409,8 +409,8 @@ IndexTable.o:
IndexTable2.o:
$(CC) $(DEFS) $(CPPFLAGS) -O2 -c $*.cpp
#Posdb.o:
# $(CC) $(DEFS) $(CPPFLAGS) -O2 -c $*.cpp
Posdb.o:
$(CC) $(DEFS) $(CPPFLAGS) -O2 -c $*.cpp
# Query::setBitScores() needs this optimization
#Query.o:

@ -1497,6 +1497,8 @@ void Msg39::estimateHitsAndSendReply ( ) {
// lookup the text of the facet in Msg40.cpp
FacetEntry *fe;
fe = (FacetEntry *)ft->getValFromSlot(k);
// sanity
if ( fe->m_count == 0 ) { char *xx=NULL;*xx=0;}
memcpy ( p , fe , sizeof(FacetEntry) );
p += sizeof(FacetEntry);
// do not breach

@ -6519,7 +6519,7 @@ bool Msg40::printFacetsForTable ( SafeBuf *sb , QueryTerm *qt ) {
, count );
// if it's a # then we print stats after
if ( isString )
if ( isString || fe->m_count == 0 )
sb->safePrintf("\n");
else
sb->safePrintf(",\n");

@ -7284,7 +7284,6 @@ void PosdbTable::intersectLists10_r ( ) {
//qt->m_facetHashTable.addTerm32(&val32
// get it
HashTableX *ft = &qt->m_facetHashTable;
FacetEntry *fe;
fe=(FacetEntry *)ft->getValue(&val32);
// debug
//log("facets: got entry for key=%"UINT32" "
@ -7299,7 +7298,11 @@ void PosdbTable::intersectLists10_r ( ) {
char *xx=NULL;*xx=0; }
memset ( &ff , 0 , sizeof(FacetEntry) );
fe = &ff;
ft->addKey(&val32,fe);
int32_t slot;
ft->addKey(&val32,fe,&slot);
// now point to what we added since
// we increment count below, add min/max, etc.
fe = (FacetEntry *)ft->getValueFromSlot(slot);
}
}