On Mon, Sep 8, 2008 at 3:56 PM, Ning Li <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 8, 2008 at 2:43 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote:
>> But, how would you maintain a static view of an index...?
>>
>> IndexReader r1 = indexWriter.getCurrentIndex()
>> indexWriter.addDocument(...)
>> IndexReader r2 = indexWriter.getCurrentIndex()
>>
>> I assume r1 will have a view of the index before the document was
>> added, and r2 after?
>
> I thought an index reader which supports real-time search no longer
> maintains a static view of an index?

It seems advantageous to just make it really cheap to get a new view
of the index (if you do it for every search, t amounts to the same
thing, right?)  Quite a bit of code in Lucene assumes a static view of
the Index I think (even IndexSearcher), and it's nice to have a stable
index view for the duration of a single request.

> Similar to InstantiatedIndexReader,
> it will be in sync with an index writer.

Right... that's why I was clarifying.  You can still make stable views
of the index with multiple InstantiatedIndex instances, but it doesn't
seem as efficient.

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to