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 Li...@emc.com on 2007/06/14 08:57:02 UTC
How to Use ParallelReader
Hi,
There is one class named org.apache.lucene.index.ParallelReader, as its javadoc stated:
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.
My question is: If I just want to update the small fields in one index and do not want to update the large fields in another index, how can I make sure these two indexes are synchronized and have the same document number?
Thanks and Regards
Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to Use ParallelReader
Posted by Chris Hostetter <ho...@fucit.org>.
: My question is: If I just want to update the small fields in one index
: and do not want to update the large fields in another index, how can I
: make sure these two indexes are synchronized and have the same document
: number?
the short answer: build them in the same order, use the exact same
IndexWriter settings, and optimize both indexes. you can rebuild either
of them again and again and again if you want -- as long as you keep doing
it in the same order.
ParallelReader is a pretty special caes class that not a lot of people
seem to use (or if they are they don't talk about it much) but there has
been a few discussions about it in the past .. i would suggest searching
the mail archives and pay special attention to anything by Chuck Williams
... he's pretty much the foremost authority on ParallelReader.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org