lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: IndexReader.openIfChanged Doesn't Work on MultiReader
Date Fri, 02 Dec 2011 23:33:20 GMT
Hi,

> I have a MultiReader made up of 3 different indexes.  If changes are made
to
> either of the 3 underlying indexes, isCurrent() returns false (correctly)
on said
> MultiReader.  However, if I use the method IndexReader.openIfChanged() on
> the MultiReader, a new MultiReader is returned (it does NOT return null),
but
> its isCurrent() method is still reporting false.  Also, a search using
this new
> MultiReader doesn't not see the index changes (deletes and additions).  I
have
> to explicitly close the MultiReader and open it again to see changes, but
the
> documentation states this is an inefficient way of refreshing readers.

It is not inefficient as MultiReader is just a light wrapper around a
collection of readers. If you simply openIfChanged (!) each subreader
yourself and wrap them by a new MultiReader it will not slowdown anything.
MultiReader.doOpenIfChanged does nothing else, but maybe with a bug
introduced by the refactoring.

> I assumed someone must have run into this before?

Can you open an issue at https://issues.apache.org/jira/browse/LUCENE ?

Uwe


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message