beaglequeue indexFiles
This commit is contained in:
+6
-2
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user