lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doz...@gmx.de
Subject RE: UpdateIndex
Date Mon, 29 Aug 2005 14:09:32 GMT
for (int i=0; i<reader.numDocs(); i++) {
  Document doc =reader.document(i);
  String path = doc.get("path");
  File file = new File(path);
  long dl = Long.parseLong(doc.get("date"));
  long fl = new File(path).lastModified();

if (!file.exists()) {reader.delete(i);}

}

i need a new IndexReader for each i?


> --- Ursprüngliche Nachricht ---
> Von: "Mordo, Aviran (EXP N-NANNATEK)" <aviran.mordo@lmco.com>
> An: java-user@lucene.apache.org
> Betreff: RE: UpdateIndex
> Datum: Mon, 29 Aug 2005 09:28:59 -0400
> 
> After you delete / add documents, you need to get a new IndexReader
> instance to reflect the changes.
> 
> HTH 
> 
> Aviran
> http://www.aviransplace.com 
> 
> -----Original Message-----
> From: dozean@gmx.de [mailto:dozean@gmx.de] 
> Sent: Monday, August 29, 2005 7:32 AM
> To: java-user@lucene.apache.org
> Subject: Re: UpdateIndex
> 
> Hi,
> 
> over again a question about updating!
> I update my index by first deletion all the documents from index which are
> not anymore in the document directories, then i delete all documents >from
> index which have changed and at last i add all documents to the index
> which are not in the index but in the document directories!!!
> But i is like that... that all works very good!
> But the problem is that it doesn't find all documents to add or delete by
> the first running!!! For example i deleted 12 documents from the directory
> or i changed them. If i start the application it delete only 7 >from
index.
> If i start the application again it delete the other rest!!! But why?
> 
> Why doesn't do it by the first time!!!?
> 
> Thanks in forward!
> Bye
> 
> --
> Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
> Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

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


Mime
View raw message