Chris Hostetter wrote:
: I think the better question could be, given a large/stale index A, a
: small/updated index B, and the B does not satisfy the requirement of
: ParallelReader. How can I create an index C that "add the same
: documents in the same order of index A"?

1) optimize A so it has a single segment with no gaps in doc ids.
2) iterate over the docs in A, looking at their "unique key" field
   -- FieldCache should be handy for this.
   2.1) For each uniqueKey in A pull the corrisponding data out of B and
        add the doc to C

...the key here being that B need not be a lucene index, just something
that provides fast lookup by your unique Key (liek a database perhaps)

Now that you mention it...

Couldn't one make an IndexReader subclass which actually constructs fake TermDocs and TermPositions from the data in a database? Then you could slot that implementation in anywhere which normally expects an IndexReader, and it would work as expected, plus you'd never have to worry about document IDs reordering themselves.

Daniel



--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

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

Reply via email to