lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: IndexSearcher.close() and aborting searches in progress
Date Wed, 08 Sep 2004 23:45:39 GMT

I haven't tried this, but I think this would be messy.  Lucene needs to
keep index files open, so that when you pull a Document from Hits, it
can read this stuff from those files.  If you close index files, you
are likely to get some NPEs or some such.

I don't think you'll find a ready to use API for this use case in
Lucene.  Instead, my guess is that you will have to manually keep track
of your IndexSearcher's status (open/closed), and allow searches to
return results only if status == open.


--- David Spencer <> wrote:

> What is the intent of IndexSearcher.close()?
> I want to know how, in a web app, one can stop a search that's in 
> progress - use case is a user is limited to one search at at time,
> and 
> when one (expensive) search is running they decide it's taking too
> long 
> so they elaborate on the query and resubmit it. Goal is for the
> server 
> to stop the search that's in progress and to start a new one. I know
> how 
> to deal w/ session vars and so on in a web container - but can one
> stop 
> a search that's in progress and is that the intent of close()?
> I haven't done the obvious experiment but regardless, the javadoc is 
> kinda terse so I wanted to hear from the all knowing people on the
> list.
> thx,
>    Dave
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message