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, 22 Aug 2005 14:22:08 GMT
Yeah, that is a good idea,
but i have the following problem of doing the update that way.

I can not query the index for the file name, because it could be
that i have many files with the same name in different directories.
So i have to query the index for the path!
I store the path in a Keyword field but i can not search after the path!
It won't work and i don't know why?  Have you an idea?

Derya

> --- Ursprüngliche Nachricht ---
> Von: "Mordo, Aviran (EXP N-NANNATEK)" <aviran.mordo@lmco.com>
> An: java-user@lucene.apache.org
> Betreff: RE: UpdateIndex
> Datum: Mon, 22 Aug 2005 09:43:05 -0400
> 
> 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.
> 
> HTH
> 
> Aviran
> http://www.aviransplace.com
> 
> -----Original Message-----
> From: dozean@gmx.de [mailto:dozean@gmx.de] 
> Sent: Monday, August 22, 2005 9:31 AM
> To: java-user@lucene.apache.org
> Subject: UpdateIndex
> 
> Hi,
> 
> i wrote an Index update, where first the IndexReader delete all files
> >from index which are changed.
> 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 http://www.gmx.net/de/go/promail
> +++ GMX - die erste Adresse für Mail, Message, More +++
> 
> ---------------------------------------------------------------------
> 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