lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <sar...@syr.edu>
Subject Re: Virtually merge two indexes?
Date Mon, 26 Mar 2007 16:03:12 GMT
I think ParallelReader, first released in Lucene-Java 1.9, should meet
your needs:

<http://lucene.apache.org/java/docs/api/org/apache/lucene/index/ParallelReader.html>

-----
An IndexReader which reads multiple, parallel indexes. Each index added
must have the same number of documents, but typically each contains
different fields. Each document contains the union of the fields of all
documents with the same document number. When searching, matches for a
query term are from the first index added that has the field.

This is useful, e.g., with collections that have large fields which
change rarely and small fields that change more frequently. The smaller
fields may be re-indexed in a new index and both indexes may be searched
together.

Warning: It is up to you to make sure all indexes are created and
modified the same way. For example, if you add documents to one index,
you need to add the same documents in the same order to the other
indexes. Failure to do so will result in undefined behavior.
-----

Steve

Chris Lu wrote:
> Hi, Gurus,
> 
> One thing I want to do is: one index has fields like [primary-key,
> not-so-frequently-updated-fields, large-content-fields,...], and
> another index has [primary-key, frequently-updated-fields]. The
> purpose is to make the indexing process faster by keeping large/stale
> fields in one index and small/frequently updated fields in another,
> linked via primary-key field.
> 
> If I do so, is it possible to keep the index search the same? Parallel
> index reader may not cut it because it works only for different
> Documents into different indexes. What I want is the same Document
> spread on different indexes.


---------------------------------------------------------------------
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