[Xapian-discuss] flush problem

Michael A. Lewis MAL at ICGINC.COM
Sun Jan 20 18:32:19 GMT 2008


I am having a problem with flushing a database. I am adding N records to the DB (which amounts to 1 - 2000). At then end of the run, I issue a flush() call. The problem is that the flush call never seems to do anything. Every 10000 additions to the database and the library performs a flush (which can take up to 3 hours on a 560,000 document database) as if my flush call was never performed.
 
Two questions: 1) This seems entirely too long, is it? 2) Why would my flush be ignored (no tranactions being used, just straight add using the term generator).
 
This is my flush code:

try {
      Xapian::WritableDatabase* database = getDatabase();
      database->flush();
} catch (const Xapian::Error & err) {
      s="ERROR:"+err.get_msg();
      log_it(s.c_str());
      write(c_id,"ERROR:-3",8);
}
return;

The getDatabase() function returns a pointer to the open database (from a pool of databases). This same code is used to fetch a pointer to the WritableDatabase object for the insert (because of my earlier problem with opening and closing the DB with each add). There are no errors logged.

Any insight or ideas would be appreciated.

Thanks,

-Michael Lewis



More information about the Xapian-discuss mailing list