lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakob <jacob...@opensuse-id.org>
Subject Re: adding documents to an existing index
Date Wed, 27 Oct 2010 13:51:43 GMT
On 10/27/10, Seth Rosen <seth@architexa.com> wrote:
> Yakob,
> Here is a snippet of an example of IndexWriter from the lucene source that
> you might find helpful.
>
>
>> IndexWriter writer = new IndexWriter(FSDirectory.open(INDEX_DIR), new
>> StandardAnalyzer(Version.LUCENE_CURRENT), true,
>> IndexWriter.MaxFieldLength.LIMITED);

// the above code should change true into false so that the index will
still be open right?
// I mean surely the index shouldn't be close
>
> System.out.println("Indexing to directory '" +INDEX_DIR+ "'...");
>
// what confuse me is how can add a new directory path containing new
Documents to a
// lucene class. so that lucene will index those new documents and add
it to an existing
// index.
> indexDocs(writer, docDir);
>
> System.out.println("Optimizing...");
>
> writer.optimize();
>
> writer.close();
>
>
> Seth Rosen
> www.architexa.com
> Understand & Document Code In Seconds
> seth@architexa.com <vineet@architexa.com>
>
>
>


-- 
http://jacobian.web.id

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