[ 
http://issues.apache.org/jira/browse/LUCENE-521?page=comments#action_12370740 ] 

Volodymyr Bychkoviak commented on LUCENE-521:
---------------------------------------------

you are not closing ramWriter. It also should be closed. 10 is default value of 
maxBufferedDocs. i.e. number of docs that are kept in internal RAMDirectory 
before flushing them to disk (or other directory implementation)


> Documents do not get added from RAMDirectory to FSDirectory if documents is 
> less than 10.
> -----------------------------------------------------------------------------------------
>
>          Key: LUCENE-521
>          URL: http://issues.apache.org/jira/browse/LUCENE-521
>      Project: Lucene - Java
>         Type: Bug
>   Components: Index
>     Versions: 1.9
>  Environment: Windows XP, J2EE 1.4
>     Reporter: Keith Morgan

>
> Disk index does not get updated unless 10 or more documents exist in a RAM 
> directory.
> Below is the code used:
> //Adding documents to RAMDirectory
> RAMDirectory ramDirectory = new RAMDirectory();
> IndexWriter ramWriter = new IndexWriter(ramDirectory, new StandardAnalyzer(), 
> true);
> ......code looping and adding docs to IndexWriter
> ramWriter.addDocument(doc);
> WriteIndex.writeRAMDirectory(ramDirectory);
> //Sending RAMDirectory to Disk
> public static void writeRAMDirectory(RAMDirectory ramDirectory) {
>      boolean exists = IndexReader.indexExists(indexDir);
>      IndexWriter diskWriter = new IndexWriter(indexDir, new 
> StandardAnalyzer(), !exists);
>      diskWriter.setMergeFactor(1000);
>      diskWriter.setMaxMergeDocs(10000);
>      diskWriter.addIndexes(new Directory[] { ramDirectory });
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to