List Info

Thread: Can changes on an index be visible to an open IndexSearcher without reopening it?




Can changes on an index be visible to an open IndexSearcher without reopening it?
user name
2007-11-05 07:48:32
Hi,
I have an application using Lucene 2.2.0 that opens an
IndexSearcher only once to optimize performance, because
opening the index is a heavy operation. My question is, if I
modify the index with an IndexWriter or IndexModifier, is
there any way for the changes to be visible to the opened
IndexSearcher without reopening it?

Thanks
Re: Can changes on an index be visible to an open IndexSearcher without reopening it?
user name
2007-11-05 08:00:42
Unfortunately, no.  Once open, the IndexReader/IndexSearcher
searches
a frozen "point in time" snapshot of the index as
it existed when it
was first opened.

You'll have to open a new searcher in order to see the
changes.

However, there is work underway now to add a
"reopen" method to
IndexReader that somewhat lowers the cost of opening a
reader (not yet
clear by how much).  This should be part of the next release
(2.3).
See here for details:

  http
s://issues.apache.org/jira/browse/LUCENE-743

Mike

"Enrique Lamas" <enrique.lamascorp.ya.com> wrote:
> Hi,
> I have an application using Lucene 2.2.0 that opens an
IndexSearcher only
> once to optimize performance, because opening the index
is a heavy
> operation. My question is, if I modify the index with
an IndexWriter or
> IndexModifier, is there any way for the changes to be
visible to the
> opened IndexSearcher without reopening it?
> 
> Thanks

------------------------------------------------------------
---------
To unsubscribe, e-mail: java-user-unsubscribelucene.apache.org
For additional commands, e-mail: java-user-helplucene.apache.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )