Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User
Move from RAMDirectory to FSDirectory causing problem sometimes
 

Index | Next | Previous | View Flat


paul_t100 at fastmail

Jul 8, 2008, 1:01 AM


Views: 2319
Permalink
Move from RAMDirectory to FSDirectory causing problem sometimes

Hi, I have been using a RAMDirectory for indexing without any problem,
but I then moved to a file based directory to reduce memory usage. this
has been working fine on Windows and OSX and my version of linux
(redhat) but is failing on a version of linux (archlinux) with 'Too many
files opened' , but they are only indexing 32 documents , I can index
thousands without a problem. It mentions this error in the Lucene FAQ
but I am not dealing directly with the filesystem myself, this is my
code for creating an index is it okay or is there some kind of close
that I am missing

thanks for any help Paul

public synchronized void reindex()
{
MainWindow.logger.info("Reindex start:" + new Date());
TableModel tableModel = table.getModel();
try
{
//Recreate the RAMDirectory uses too much memory
//directory = new RAMDirectory();
directory =
FSDirectory.getDirectory(Platform.getPlatformLicenseFolder()+ "/" +
TAG_BROWSER_INDEX);
IndexWriter writer = new IndexWriter(directory, analyzer, true);

//Iterate through all rows
for (int row = 0; row < tableModel.getRowCount(); row++)
{
//for each row make a new document
Document document = createDocument(row);
writer.addDocument(document);

}
writer.optimize();
writer.close();
}
catch (Exception e)
{
throw new RuntimeException("Problem indexing Data:" +
e.getMessage());
}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Subject User Time
Move from RAMDirectory to FSDirectory causing problem sometimes paul_t100 at fastmail Jul 8, 2008, 1:01 AM
    Re: Move from RAMDirectory to FSDirectory causing problem sometimes lucene at mikemccandless Jul 8, 2008, 2:56 AM
    Re: Move from RAMDirectory to FSDirectory causing problem sometimes paul_t100 at fastmail Jul 8, 2008, 3:03 AM
        Re: Move from RAMDirectory to FSDirectory causing problem sometimes lucene at mikemccandless Jul 8, 2008, 3:14 AM
        Re: Move from RAMDirectory to FSDirectory causing problem sometimes lucene at mikemccandless Jul 8, 2008, 3:15 AM
    Re: Move from RAMDirectory to FSDirectory causing problem sometimes paul_t100 at fastmail Jul 8, 2008, 3:38 AM
        Re: Move from RAMDirectory to FSDirectory causing problem sometimes lucene at mikemccandless Jul 8, 2008, 8:39 AM
        Re: Move from RAMDirectory to FSDirectory causing problem sometimes lucene at mikemccandless Jul 8, 2008, 9:14 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.