Hi, 

> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 

> Ah, sorry.  That last section is in a method that gets called 
> in a loop.

The shortest version of your code is:
-----------------
 void mainFunction() {
        IndexWriter writer = null;
        writer = new IndexWriter( mainindex, new StandardAnalyzer(), false
);
        moveDocumentsOver( writer, oldDirectory);       
        writer.close();
 }

 void moveDocumentsOver( IndexWriter writer, string oldDirectory){
        IndexReader r = null;
        r = IndexReader.open( oldDirectory );
        int num = r.numDocs();
        for ( int i = 0; i < num; i++ ) {
              if ( !r.isDeleted( i ) ) { 
                Document d = r.document( i );
                Document nd = new Document();
                // fill nd by d
                writer.addDocument( nd );
          }
        }
        r.close();
}
-----------------

And then you execute the search (using mainindex) and you don't see the new
documents. Yes?

Pasha Bizhan
http://lucenedotnet.com



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

Reply via email to