Changed the way we handle document sizes. The fbytes field should now be in most cases the most "natural" document size. pcbytes holds the top external container size and dbytes the text size

This commit is contained in:
Jean-Francois Dockes
2012-03-07 15:39:30 +01:00
parent 638d468796
commit 85166c93b2
10 changed files with 108 additions and 32 deletions
+6 -4
View File
@@ -242,7 +242,7 @@ bool BeagleQueueIndexer::indexFromCache(const string& udi)
doc.mimetype = dotdoc.mimetype;
doc.fmtime = dotdoc.fmtime;
doc.url = dotdoc.url;
doc.fbytes = dotdoc.fbytes;
doc.pcbytes = dotdoc.pcbytes;
doc.sig.clear();
doc.meta[Rcl::Doc::keybcknd] = "BGL";
return m_db->addOrUpdate(udi, cstr_null, doc);
@@ -405,7 +405,7 @@ BeagleQueueIndexer::processone(const string &path,
char cbuf[100];
sprintf(cbuf, OFFTPC, stp->st_size);
dotdoc.fbytes = cbuf;
dotdoc.pcbytes = cbuf;
// Document signature for up to date checks: none.
dotdoc.sig.clear();
@@ -452,7 +452,7 @@ BeagleQueueIndexer::processone(const string &path,
char cbuf[100];
sprintf(cbuf, OFFTPC, stp->st_size);
doc.fbytes = cbuf;
doc.pcbytes = cbuf;
// Document signature for up to date checks: none.
doc.sig.clear();
doc.url = dotdoc.url;
@@ -466,7 +466,9 @@ BeagleQueueIndexer::processone(const string &path,
{
// doc fields not in meta, needing saving to the cache
dotfile.m_fields.set("fmtime", dotdoc.fmtime, cstr_null);
dotfile.m_fields.set("fbytes", dotdoc.fbytes, cstr_null);
// fbytes is used for historical reasons, should be pcbytes, but makes
// no sense to change.
dotfile.m_fields.set(cstr_fbytes, dotdoc.pcbytes, cstr_null);
dotfile.m_fields.set("udi", udi, cstr_null);
string fdata;
file_to_string(path, fdata);
+2 -2
View File
@@ -458,7 +458,7 @@ FsIndexer::processone(const std::string &fn, const struct stat *stp,
char cbuf[100];
sprintf(cbuf, OFFTPC, stp->st_size);
doc.fbytes = cbuf;
doc.pcbytes = cbuf;
// Document signature for up to date checks: concatenate
// m/ctime and size. Looking for changes only, no need to
// parseback so no need for reversible formatting. Also set,
@@ -519,7 +519,7 @@ FsIndexer::processone(const std::string &fn, const struct stat *stp,
char cbuf[100];
sprintf(cbuf, OFFTPC, stp->st_size);
fileDoc.fbytes = cbuf;
fileDoc.pcbytes = cbuf;
// Document signature for up to date checks.
makesig(stp, fileDoc.sig);
#ifdef IDX_THREADS