[Xapian-discuss] Clearing Database For Tests

Ryan Bates ryan at railscasts.com
Mon Nov 2 23:36:01 GMT 2009


I am using Xapian through the Ruby bindings and am wondering the best
way to use it in a unit test suite where we must start with an empty
database every time (so records generated in one test don't interfere
with another). I am currently deleting the database directory and
regenerating it every time, but I find this to be very slow (nearly
half a second). This results in even a small number of tests taking a
long time to run.

Is there some fast way to clear an existing database of all content
(terms, values, spellings, etc.)? If not, what is the best practice
for resetting a database for each test?

Regards,

Ryan



More information about the Xapian-discuss mailing list