lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: managing docids for ParallelReader (was Augmenting an existing index)
Date Tue, 31 May 2005 18:20:31 GMT
Matt Quail wrote:
>> I have a similar problem, for which ParallelReader looks like a good
>> solution -- except for the problem of creating a set of indices with
>> matching document numbers.
> 
> 
> I have wondered about this as well. Are there any *sure fire* ways of  
> creating (and updating) two indices so that doc numbers in one index  
> deliberately correspond to doc numbers in the other index?

If you add the documents in the same order to both indexes and perform 
the same deletions on both indexes then they'll have the same numbers.

If this is not convenient, then you could add an id field to all 
documents in the primary index.  Then create (or re-create) the 
secondary index by iterating through the values in a FieldCache of this 
id field.

ParallelReader was not really designed to support incremental updates of 
fields, but rather to accellerate batch updates.  For incremental 
updates you're probably better served by updating a single index.

One could define an "acl" IndexReader subclass that generates termDoc 
lists on the fly by looking in an external database.  This would require 
a mapping between Lucene document ids and external document IDs.  A 
FieldCache, as described above, could serve that purpose.

Doug

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


Mime
View raw message