[Xapian-discuss] how to delete all document from the DB (without deleting the DB itself)

Alessandro Pasotti apasotti at gmail.com
Thu Apr 24 18:47:35 BST 2008


2008/4/24 Rusty Conover <rconover at infogears.com>:
>
> On Apr 24, 2008, at 11:25 AM, Alessandro Pasotti wrote:
>
>
> > Hello,
> >
> > I'm still testing PHP5 bindings and I could'nt find a way to delete
> > all documents from a DB without deleting other informations stored in
> > the DB such as synonyms.
> >
> > Since the process of adding synonyms is time consuming, I would like
> > to use the same DB but restart my test without any document in the DB,
> > is this possibile?
> >
> > I could'nt find a delete_all or a method like that, nor an iterator
> > over all documents without querying.
> >
> > Any idea?
> >
> >
>
>  Hi,
>
>  Why is adding synonyms a time consuming operation, it seems pretty constant
> time from my experience.

Sorry, I didn't want to criticize the speed of this routine, I was
just  saying that since I'm running unit tests I must restart from a
clean DB every time and I just wanted to avoid re-inserting the
synonyms all the times just to do a test run.

BTW I'm now trying to put synonyms in a seperate DB.

But my question is still valid: how do I iterate over all documents in
the DB without running a query? Or which query to run to return all
documents?

Cheers

-- 
Alessandro Pasotti
w3: www.itopen.it



More information about the Xapian-discuss mailing list