You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Anthony Urso <an...@gmail.com> on 2008/07/26 03:42:57 UTC

LUCENE-1315 status?

Can people-in-the-know comment and/or take action on LUCENE-1315?

If it is unpalateable, let me know the right way to do something along
these lines:

    reader = IndexReader.open(directory);
    searcher = new IndexSearcher(reader);

    LocateRegistry.createRegistry(port);
    Naming.rebind(name, new RemoteSearchable(searcher));

    while (true) {
        IndexReader oldReader = reader;
        reader = oldReader.reopen();
        searcher.setIndexReader(reader);
        oldReader.close();
    }

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


Re: LUCENE-1315 status?

Posted by Michael McCandless <lu...@mikemccandless.com>.
I'm less familiar with IndexSearcher, but I agree this issue  
(LUCENE-1203 is the original one) has been open for quite a while and  
there seems to be some demand to set an IndexReader on an existing  
IndexSearcher.

However, I think Yonik spells out the concerns in LUCENE-1203:  each  
instance of IndexReader, and each instance of IndexSearcher, are  
assumed to search an unchanging "point in time" snapshot of the index  
and so in order to get a changed IndexSearcher you need to 1) reopen  
the IndexReader (potentially high cost operation), and 2) wrap that  
new IndexReader into an IndexSearcher (a very low cost operation).

Maybe you could change your code below to either rebind a new searcher  
every time a new IndexReader is reopened, or, you could make a  
separate class that has a getSearcher() method that the client code  
must invoke every time it wants to do a search?

Mike

Anthony Urso wrote:

> Can people-in-the-know comment and/or take action on LUCENE-1315?
>
> If it is unpalateable, let me know the right way to do something along
> these lines:
>
>    reader = IndexReader.open(directory);
>    searcher = new IndexSearcher(reader);
>
>    LocateRegistry.createRegistry(port);
>    Naming.rebind(name, new RemoteSearchable(searcher));
>
>    while (true) {
>        IndexReader oldReader = reader;
>        reader = oldReader.reopen();
>        searcher.setIndexReader(reader);
>        oldReader.close();
>    }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


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