search for: slot_cyrusid

Displaying 2 results from an estimated 2 matches for "slot_cyrusid".

2013 Jun 19
2
Compact databases and removing stale records at the same time
...; /* copy all matching documents to the new DB */ Xapian::PostingIterator it; for (it = srcdb.postlist_begin(""); it != srcdb.postlist_end(""); it++) { Xapian::docid did = *it; Xapian::Document doc = srcdb.get_document(did); std::string cyrusid = doc.get_value(SLOT_CYRUSID); if (cb(cyrusid.c_str(), rock)) { destdb.add_document(doc); } } /* commit all changes explicitly */ destdb.commit(); } FYI: SLOT_CYRUSID is just 0. Thanks heaps for your help on this. Honestly, it's not a deal-breaker for us to use this much CPU. It's a pain, but it...
2013 Jun 19
2
Compact databases and removing stale records at the same time
...::WritableDatabase(dest, Xapian::DB_CREATE_OR_OPEN); destdb->begin_transaction(); /* copy all matching documents to the new DB */ for (Xapian::MSetIterator i = matches.begin() ; i != matches.end() ; ++i) { Xapian::Document doc = i.get_document(); std::string cyrusid = doc.get_value(SLOT_CYRUSID); if (cb(cyrusid.c_str(), rock)) { destdb->add_document(doc); count++; /* commit occasionally */ if (count % 1024 == 0) { destdb->commit_transaction(); destdb->begin_transaction(); } } } /* commit all the remaining transactions */ destdb->commit_trans...