lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Optimize, OutOfMemory + Merge
Date Mon, 05 Sep 2005 10:17:44 GMT
You should call .optimize() instead of merging.

     Erik


On Sep 5, 2005, at 5:22 AM, Martin Rode wrote:

> Hi all,
>
> The code snipset below does NOT result in an optimized index in one  
> of my test cases. As I understand, the optimized index, means that  
> there is only ONE segment file in the index folder. After this code  
> has run, I sometimes have 100 segment files in the directory.
>
> When I call optimize() on the writer, most of the time I get  
> OutOfMemory (even with 800MB for the JVM).
>
> What do I do wrong?
>
> Best,
> Martin
>
> ---- code snip start -----
>                // optimize index
>                IndexReader[] readers = new IndexReader[1];
>                readers[0] = IndexReader.open(diri);
>                writer = new IndexWriter(diri+"-optimized", anal,  
> true);
>                System.out.println("Merging to new Index: '"+diri+"- 
> optimized'");
>                writer.addIndexes(readers);
>                System.out.println("Done Merging.");
>                readers[0].close();
> ---- code snip end ----
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


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