lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mordo, Aviran (EXP N-NANNATEK)" <>
Subject RE: UpdateIndex
Date Mon, 22 Aug 2005 13:43:05 GMT
In your approach, you are reading all the documents in your index. You should instead query
the index for the file name instead of reading the entire index for each file.



-----Original Message-----
From: [] 
Sent: Monday, August 22, 2005 9:31 AM
Subject: UpdateIndex


i wrote an Index update, where first the IndexReader delete all files from index which are
Than add documents which are not in the index!

Alone the deletion take so long, because i have 2 "for" loops!

file = array with all files in a directory

for (int i = 0; i<file.length; i++) {
	if (file[i].isFile()) {
   for (int j =0; j<reader.numDocs(); j++) {
	if (file[i].getName() == reader.document(j).get("name") &&
	file[i].lastModified() > Integer.parseInt(reader.document(j).get("date")))
{						reader.delete(j); 

Maybe this is the wrong way?

Bye Derya

5 GB Mailbox, 50 FreeSMS
+++ GMX - die erste Adresse für Mail, Message, More +++

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message