beaglequeue indexFiles

This commit is contained in:
dockes
2009-11-14 08:21:45 +00:00
parent bbba826c06
commit 6ef7b546f2
10 changed files with 204 additions and 94 deletions
+6 -2
View File
@@ -1270,7 +1270,7 @@ bool Db::purge()
}
/* Delete document(s) for given unique identifier (doc and descendents) */
bool Db::purgeFile(const string &udi)
bool Db::purgeFile(const string &udi, bool *existed)
{
LOGDEB(("Db:purgeFile: [%s]\n", udi.c_str()));
if (m_ndb == 0 || !m_ndb->m_iswritable)
@@ -1280,8 +1280,12 @@ bool Db::purgeFile(const string &udi)
string ermsg;
try {
Xapian::PostingIterator docid = db.postlist_begin(uniterm);
if (docid == db.postlist_end(uniterm))
if (docid == db.postlist_end(uniterm)) {
if (existed)
*existed = false;
return true;
}
*existed = true;
LOGDEB(("purgeFile: delete docid %d\n", *docid));
db.delete_document(*docid);
vector<Xapian::docid> docids;
+1 -1
View File
@@ -121,7 +121,7 @@ class Db {
const Doc &doc);
/** Delete document(s) for given UDI, including subdocs */
bool purgeFile(const string &udi);
bool purgeFile(const string &udi, bool *existed = 0);
/** Remove documents that no longer exist in the file system. This
* depends on the update map, which is built during