It might be worthwhile to have a "hibernate" mode for solr, where <suspend>
waits until all requests are finished, then closes all files and rejects all
new requests. Later a <wakeup> command would bring it back online. During
this time, a remotely controlled job could remove the data directory. This
"hibernate" mode would be useful in general for doing query rate and machine
usage control.

Lance

-----Original Message-----
From: Sundling, Paul [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 21, 2007 4:21 PM
To: solr-user@lucene.apache.org
Subject: RE: clear index

Trying the query approach with a 3GB indexing takes over a minute to clear
the index.

The reason why to not stop the servlet container and delete the files
manually is that in a particular environment the person testing may not have
access to the filesystem directly.  Usually you want to do performance
testing on servers, although I'll certainly run some locally at first when
testing the process works. :)  I could remove the index with java.io
programmatcally.

I'm just seeing if there's an easy/performant way of doing it with Solr.
For a solution with raw Lucene, creating a new index with the same directory
cleared out an old index (even on Windows with it's file
locking) quickly.  

Paul Sundling

-----Original Message-----
From: Charles Hornberger [mailto:[EMAIL PROTECTED]
Sent: Monday, August 20, 2007 10:03 PM
To: solr-user@lucene.apache.org
Subject: Re: clear index


IIRC you can also also simply stop the servlet container, delete the
contents of the data directory by hand, then restart the container.

-Charlie

On 8/20/07, Pieter Berkel <[EMAIL PROTECTED]> wrote:
> If you are using solr 1.2 the following command (followed by a commit 
> /
> optimize) should do the trick:
>
> <delete><query>*:*</query></delete>
>
> cheers,
> Piete
>
>
> On 21/08/07, Sundling, Paul <[EMAIL PROTECTED]> wrote:
> >
> > what is the best approach to clearing an index?
> >
> > The use case is that I'm doing some performance testing with various

> > index sizes.  In between indexing (embedded and soon HTTP/XML) I 
> > need to clear the index so I have a fresh start.
> >
> > What's the best approach, close the index and delete the files?  
> > Hack together some query that will match all documents and delete by

> > query? Looking at the Lucene API it looks like they have the same 
> > functionality that is exposed already (delete by id or query).
> >
> > Paul Sundling
> >
> >
>

Reply via email to