lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Adding Documents to index in a batch process
Date Thu, 28 Jun 2007 18:39:04 GMT
I guess I don't understand the problem. Can you build the documents
from within a loop or not? If you can, it's simple...

open indexwriter
while (build a document)
    write to index

close/optimize.

Or are you saying that you can't build from within a loop?

Best
Erick

On 6/28/07, Kai Weber <kai.weber@glorybox.de> wrote:
>
> Hello,
>
> In my application I have to add documents to the index as follows:
>
> 1. build the document to add from a repository
> 2. obtain an IndexWriter
> 2. add document to index
> 4. write and optimize index, close writer
> 5. goto 1 until no documents left
>
> I must work with a legacy code witch does the document
> building and no easy way to get indexing into it like I was used to
> (foreach document... add to index then write and close indexer).
>
> How could I resuse the IndexWriter? My idea is to have something like
> this:
>
> 1. create IndexWriter
> 2. reuse IndexWriter
> 3. add document to index
> 4. goto 2 until no documents left
> 5. write and optimize index, close writer
>
> How would you implement this? Are there any examples I could look at?
>
> Regards, Kai
> --
> * http://www.glorybox.de/
>   PGP 1024D/594D4132 B693 5073 013F 7F56 5DCC  D9C2 E6B5 448C 594D 4132
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message