Nuno,

Check towards the end of this article: 
http://www.onjava.com/pub/a/onjava/2003/03/05/lucene.html

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Nuno Seco <ns...@dei.uc.pt>
> To: java-...@lucene.apache.org
> Sent: Friday, January 2, 2009 12:53:14 PM
> Subject: Too many open files
> 
> Hello.
> 
> I'm struggling with the following exception:
> 
> Exception in thread "Lucene Merge Thread #1037" 
> org.apache.lucene.index.MergePolicy$MergeException: 
> java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many open 
> files)
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler.handleMergeException(ConcurrentMergeScheduler.java:309)
>  
> 
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:286)
>  
> 
> Caused by: java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many open 
> files)
> 
> 
> I have only one indexwriter instantiated, and every time i update the index 
> (add 
> or remove a document), i commit the indexwriter and run the following code in 
> order to make the searcher aware of the new documents:
> 
> private synchronized void refreshSearcher() throws CorruptIndexException, 
> IOException
>   {
>       try
>       {
>           IndexReader reader = searcher.getIndexReader().reopen();            
>   
>                     searcher.close();
>           searcher = new IndexSearcher(reader);
> 
>           if (reader != searcher.getIndexReader())
>               searcher.getIndexReader().close();                             }
>       catch (Exception e)
>       {
>           e.printStackTrace();
>       }
> 
>   }
> 
> 
> I have tried lowering the merge factor and the number of threads by executing 
> the following:
> ((ConcurrentMergeScheduler)writer.getMergeScheduler()).setMaxThreadCount(1); 
> writer.setMergeFactor(3);
> 
> 
> I am using lucene 2.4.0 and there is only one thread manipulating the index.
> 
> any help would be appreciated.
> 
> Nuno Seco
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-dev-h...@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to