lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "OJ" <l...@aurebekk.net>
Subject IndexWriter.docCount() reporting 0
Date Tue, 18 May 2004 11:18:56 GMT
Hi!

I'm having some trouble with an index of mine. Basically, I'm having a
content managment system with a timertask that regularily triggers an
indexing method. This method indexes content that has been added to the
CMS since last excecution of the indexing method. This all works fine...
Or so it seems. During this weekend I ran an automated test where I
change, add and delete objects in the CMS to see if they are indexed
alright. After some 13 hours of reporting numbers between 120-160
documents, my IndexWriter suddenly reported 0 (and kept on doing it for 2
days). There was no Exception prior to this - it just happened. A simple
restart made the index work again, so I guess the actual index folder
content is allright.

Basically, all I do is :

on timed intervals {
   create org.apache.lucene.index.IndexReader indexReader from basedir;
   while( there are changed/deleted documents ) {
      indexReader.delete( some term );
   }
   indexReader.close()
   create org.apache.lucene.index.IndexWriter indexWriter from basedir;
   while( there are added/changed documents ){
      create org.apache.lucene.document.Document and add fields;
      indexWriter.addDocument();
   }
   indexWriter.optimize();
   system.out.println( "I am indexing " + indexWriter.docCount() );
   indexWriter.close();
}

Has anyone experienced similar problems? Anyone found a way to "kick" the
IndexWriter back into action without restarting?
I'm running Resin 2.1.10 on windows XP, java version 1.4.2_03 and Lucene
version 1.3 final.

OJ

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message