You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by sunildm4u <su...@gmail.com> on 2006/09/15 16:29:38 UTC

Delay Problem Adding a document to existing index

Hi

   I am new to lucene..In my project we are implementing serch engine
through lucene.we have lacs of records.The problem is

Once if i index 50000 records its takes approximation 20 min. Now thnk i
want to add  5 more records to database. if  i use

     IndexWriter indexWriter = new IndexWriter(getFilePath(),
getAnalyzer(),false)

Then also its creating all the index from sctratch.. which again takes 20
min for  extra 5 records.. Its not affordable does any one has a 

solution for this.. i am sending the code for your reference

IndexWriter indexWriter = new IndexWriter(getFilePath(),
getAnalyzer(),false);

while (resultSet.next()) {

Document document = new Document();	
          	 
                document.add(new Field("Surname",
resultSet.getString("NAME_1"),Field.Store.YES,Field.Index.TOKENIZED));
	
                indexWriter.addDocument(document);

            	count= count+1;
	
	System.out.println("indexed :" + count + " " +
resultSet.getString("NAME_1"));

          }
	
	indexWriter.optimize();
	
	indexWriter.close();
 
-- 
View this message in context: http://www.nabble.com/Delay-Problem-Adding-a-document-to-existing-index-tf2277884.html#a6326374
Sent from the Lucene - Java Developer forum at Nabble.com.