Displaying 2 results from an estimated 2 matches for "srcdb".
Did you mean:
srcb
2013 Jun 19
2
Compact databases and removing stale records at the same time
...ve -1 -V0 xapian.58 | wc -l
89419
> But there's no need to run a match just to be able to iterate all the
> [...]
> There's no need to use transactions 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...
2013 Jun 19
2
Compact databases and removing stale records at the same time
...true if document should be copied, false if not */
int xapian_filter(const char *dest, const char **sources,
int (*cb)(const char *cyrusid, void *rock),
void *rock)
{
int r = 0;
int count = 0;
try {
/* set up a cursor to read from all the source databases */
Xapian::Database *srcdb = new Xapian::Database();
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 */
Xa...