lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <>
Subject Re: NRT and Caching based on IndexReader
Date Tue, 18 May 2010 01:23:58 GMT
On Mon, May 17, 2010 at 9:14 PM, Shay Banon <> wrote:
> Oh, and one more thing. Deleted docs is a sub case, with NRT, most people
> will almost always add docs as well... . So it is still not really usable
> for field cache, right?

FieldCache should be fine for the general cases - the same entry will
be used if the segment hasn't changed at all, or if the segment has
only changed which documents are deleted.  Adding new documents adds
new segments and does affect (until merge) existing segments, so the
entries will be reused.


> On Tue, May 18, 2010 at 4:12 AM, Shay Banon <> wrote:
>> Just saw that you opened a case for that. I think that its important in
>> your test case to also test for object identity, not just equals. This is
>> because the IndexReader (or the FieldCacheKey) are used as keys in weak hash
>> maps, which uses identity (==) equality for keys.
>> If FieldCacheKey is supposed to represent the key by which index readers
>> should be tested for "equality" (for example, it will be used in the
>> CachingWrapperFilter), and not the index reader itself, then I think it
>> should be renamed. What do you think? I am just looking now at what it does,
>> its new...
>> -shay.banon
>> On Tue, May 18, 2010 at 4:04 AM, Yonik Seeley <>wrote:
>>> On Mon, May 17, 2010 at 9:00 PM, Shay Banon <> wrote:
>>> > Great, so I am not imagining things this late into the night ... ;), not
>>> so
>>> > great, since using NRT with field cache (like sorting) or caching
>>> filters,
>>> > or anything that caches based on IndexReader not really an option. This
>>> > makes NRT very problematic to use in a real application.
>>> NRT is still pretty new :-)  And I do believe this is a bug, so we'll
>>> get it fixed.
>>> It's not actually a problem for FieldCache though - it no longer keys
>>> on the reader directly (if deleted docs are the only things that have
>>> changed, the FieldCache entry can still be shared).
>>> -Yonik
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> For additional commands, e-mail:

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

View raw message