You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Christoph Kaser <lu...@iconparc.de> on 2012/04/05 16:27:42 UTC

Re: Document-Ids and Merges

Thank you both Mike and Shai for your answers.

If anyone has a similiar problem:
I ended up using a column that provides my own "document ids", whose 
values I got using the fieldcache.
I then precalculate the indirection per IndexReader and store it in a 
WeakHashMap<IndexReader,float[]> to save the extra lookup.

Christoph Kaser

Am 28.03.2012 19:40, schrieb Michael McCandless:
> On Wed, Mar 28, 2012 at 3:37 AM, Christoph Kaser
> <ch...@iconparc.de>  wrote:
>> Thank you for your answer!
>>
>> That's too bad. I thought of using my own ID-field, but I wanted to save the
>> additional indirection (from docId to my ID to my value).
>> Do document IDs remain constant for one IndexReader as long as it isn't
>> reopened? If so, I could precalculate the indirection.
> Yes, the entire view of the index presented by a single IndexReader is
> unchanging (not just docIDs: everything).
>
> On reopen, a new IndexReader is returned, so the old IndexReader is
> still unchanged.
>
> So, if you can hold your arrays per-segment, and init them per-segment
> (such as FieldCache, or DocValues (only in 4.0) as Shai described)
> then you can safely use the docID to index those arrays just within
> the context of that segment.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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