Displaying 2 results from an estimated 2 matches for "destdb".
Did you mean:
testdb
2013 Jun 19
2
Compact databases and removing stale records at the same time
...);
while (*sources) {
srcdb->add_database(Xapian::Database(*sources++));
}
Xapian::Enquire enquire(*srcdb);
enquire.set_query(Xapian::Query::MatchAll);
Xapian::MSet matches = enquire.get_mset(0, srcdb->get_doccount());
/* create a destination database */
Xapian::WritableDatabase *destdb = new Xapian::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 = d...
2013 Jun 19
2
Compact databases and removing stale records at the same time
...to do this - outside of
> [...]
v2:
try {
/* set up a cursor to read from all the source databases */
Xapian::Database srcdb = Xapian::Database();
while (*sources) {
srcdb.add_database(Xapian::Database(*sources++));
}
/* create a destination database */
Xapian::WritableDatabase destdb = Xapian::WritableDatabase(dest, Xapian::DB_CREATE);
/* 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_docu...