lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Blase <mblas...@gmail.com>
Subject Re: old fashioned....."Too many open files"!
Date Fri, 18 May 2012 17:24:23 GMT
also.....my problem is indexing!

Preparation:

private void SetUpWriters() throws Exception {
        Set set = IndexesPaths.entrySet();
        Iterator i = set.iterator();

        while(i.hasNext()){
            Map.Entry index = (Map.Entry)i.next();
            int id = (Integer)index.getKey();
            String path = (String)index.getValue();

            File app = new File(path);
            Directory dir = FSDirectory.open(app);
            IndexWriterConfig config = new
IndexWriterConfig(LuceneVersion.CurrentVersion,new
StandardAnalyzer(LuceneVersion.CurrentVersion));

            //config.setMaxBufferedDocs(50);
            config.setRAMBufferSizeMB(400);
            TieredMergePolicy mp =
(TieredMergePolicy)config.getMergePolicy();
            mp.setUseCompoundFile(true);
            config.setMergePolicy(mp);

            /*
            LogMergePolicy lmp = (LogMergePolicy)config.getMergePolicy();
            lmp.setUseCompoundFile(true);
            lmp.setMaxMergeDocs(10000);
            config.setMergePolicy(lmp);
            */

            Writers.put(id, new IndexWriter(dir,config));
        }
    }


adding document:

public void AddDocument(Document doc,Analyzer analyzer) throws
CorruptIndexException, IOException {
        IndexWriter im = Writers.get(this.CurrentOpenIndex_ID);
        im.addDocument(doc, analyzer);
    }


there's not much more I'm doing!

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