lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn van Groningen (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3360) Move FieldCache to IndexReader
Date Fri, 05 Aug 2011 09:07:27 GMT


Martijn van Groningen commented on LUCENE-3360:

Thanks Hoss - Lots of issues related to the FieldCache! I got some reading to do :)

bq. I think that the distance between putting FieldCache in IndexReader to allow plugging-in
any Cache is very small, and does not require much 
more efforts.
I like the idea of a general cache. However I think we should do very small steps at the time.
All these issues / proposals include a lot of changes and I think we have a bigger chance
to commit something if we take small steps. So we could add the cache infrastructure to the
IndexReader in a separate issue after this issue has been resolved. 

bq. (but got hung up on other things, particularly how reopen would affect this)
In this draft patch in case of a reopen / clone the new SegmentIndexReader just gets the FieldCache
instance from the previous SegmentIndexReader.

> Move FieldCache to IndexReader
> ------------------------------
>                 Key: LUCENE-3360
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Martijn van Groningen
>             Fix For: 3.4, 4.0
>         Attachments: LUCENE-3360.patch
> Move the static FieldCache.DEFAULT field instance to atomic IndexReaders, so that FieldCache
insanity caused by the WeakHashMap no longer occurs.
> * Add a new method to IndexReader that by default throws an UOE:
> {code}public FieldCache getFieldCache(){code}
> * The SegmentReader implements this method and returns its own internal FieldCache implementation.
This implementation just uses a HashMap<Entry<T>,Object>> to store entries.
> * The SlowMultiReaderWrapper implements this method as well and basically behaves the
same as the current FieldCacheImpl.
> This issue won't solve the insanity that comes from inconsistent usage of a single field
(for example retrieve both int[] and DocTermIndex for the same field). 

This message is automatically generated by JIRA.
For more information on JIRA, see:


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

View raw message