mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-04 12:17:35 +03:00
Fix gigabit corruption.
Add scaffolding to show json metadata in summaries. *WIP*
This commit is contained in:
parent
32987e76ee
commit
fab62fab3f
@ -587,6 +587,12 @@ bool Msg20Reply::sendReply ( XmlDoc *xd ) {
|
||||
gettimeofdayInMilliseconds() ,
|
||||
color );
|
||||
|
||||
// FIXME
|
||||
//int32_t mdLen = 0;
|
||||
// char* md = xd->getMetadata(&mdLen);
|
||||
// if(mdLen) {
|
||||
// log("this has metadata %s", md);
|
||||
// }
|
||||
// . del the list at this point, we've copied all the data into reply
|
||||
// . this will free a non-null State20::m_ps (ParseState) for us
|
||||
mdelete ( xd , sizeof(XmlDoc) , "xd20" );
|
||||
|
12
XmlDoc.cpp
12
XmlDoc.cpp
@ -10670,6 +10670,18 @@ bool XmlDoc::addGigabits(Words *ww,int64_t docId,Sections *sections,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
char* XmlDoc::getMetadata(int32_t* retlen) {
|
||||
if(!m_hasMetadata) {
|
||||
*retlen = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*retlen = size_metadata;
|
||||
return ptr_metadata;
|
||||
|
||||
}
|
||||
|
||||
// . this is called by Msg40.cpp to intersect gigabits from multiple docs
|
||||
// . returns -1 and sets g_errno on error
|
||||
// . returns # of GigabitInfos stored into "top"
|
||||
|
1
XmlDoc.h
1
XmlDoc.h
@ -599,6 +599,7 @@ class XmlDoc {
|
||||
char *getMetaDescription( int32_t *mdlen ) ;
|
||||
char *getMetaSummary ( int32_t *mslen ) ;
|
||||
char *getMetaKeywords( int32_t *mklen ) ;
|
||||
char *getMetadata(int32_t* retlen);
|
||||
bool addGigabits ( char *s , int64_t docId , uint8_t langId ) ;
|
||||
bool addGigabits2 ( char *s,int32_t slen,int64_t docId,uint8_t langId);
|
||||
bool addGigabits ( class Words *ww ,
|
||||
|
Loading…
Reference in New Issue
Block a user