You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by do...@gmx.de on 2005/08/22 15:30:33 UTC

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


Re: UpdateIndex

Posted by Daniel Naber <lu...@danielnaber.de>.
On Wednesday 24 August 2005 12:47, dozean@gmx.de wrote:

> what can i do with files which are deleted from the document directory?
> How can i delete them from the index, if i start an update?

See IndexHTML.java in the Lucene demos.

Regards
 Daniel

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


Re: UpdateIndex

Posted by do...@gmx.de.
Hi,

what can i do with files which are deleted from the document directory?
How can i delete them from the index, if i start an update?

Currently i start a search in the index for existing documents and delete
them, when they have changed! After that session i add all the documents,
which are not in the index by searching in the index.

So it could not work thatway because i can not search for a file, witch
does't exists!!! And the reading of the index with the indexreader take so
much time!!! so? you have an idea?

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


Re: UpdateIndex

Posted by Miles Barr <mi...@runtime-collective.com>.
On Tue, 2005-08-23 at 13:53 +0200, Derya Kasapoglu wrote:
> Thank you for your help!!!
> 
> I try it without Analyzer!
> 
> document.add(Field.Keyword("path", file[i].getAbsolutePath()));
> 
> then
> 
> Term term = new Term("path", file[i].getAbsolutePath());
> Query query = new TermQuery(term);
> reader.delete(term);
> 
> so is better! :) and it works!!!!

That's the easiest way to do it, keep one copy of the field that has
gone through the StandardAnalyzer and one version as a keyword. Then you
can use the keyword version when you need to look up a particular
document, e.g. to delete it.



-- 
Miles Barr <mi...@runtime-collective.com>
Runtime Collective Ltd.


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


Re: UpdateIndex

Posted by Derya Kasapoglu <do...@gmx.de>.
Thank you for your help!!!

I try it without Analyzer!

document.add(Field.Keyword("path", file[i].getAbsolutePath()));

then

Term term = new Term("path", file[i].getAbsolutePath());
Query query = new TermQuery(term);
reader.delete(term);

so is better! :) and it works!!!!



> --- Ursprüngliche Nachricht ---
> Von: "Derya Kasapoglu" <do...@gmx.de>
> An: java-user@lucene.apache.org
> Betreff: Re: UpdateIndex
> Datum: Tue, 23 Aug 2005 13:33:05 +0200 (MEST)
> 
> I meant the reader.hasDeletions() returns null and reader.delete(term)
> returns 0.
> 
> So...!
> I store the path that way in the index:
> document.add(Field.Text("pathLC", file[i].getAbsolutePath()));
> and i use the StandardAnalyzer.
> I can not search for the path if i store it as Keyword like that:
> document.add(Field.Keyword("pathLC",
> file[i].getAbsolutePath().toLowerCase()));
> so i store it as a Text!!!
> 
> so i think i have to use the analyzer bevor i call delete(term) ?
> i'm right? 
> 
> 
> > --- Ursprüngliche Nachricht ---
> > Von: Miles Barr <mi...@runtime-collective.com>
> > An: java-user@lucene.apache.org
> > Betreff: Re: UpdateIndex
> > Datum: Tue, 23 Aug 2005 12:09:07 +0100
> > 
> > On Tue, 2005-08-23 at 12:54 +0200, Derya Kasapoglu wrote:
> > > Yes, it returns null.
> > > But this is a little bit funny because the searching is correct
> > > and it finds the document whitch have changed!
> > > So want can i do!?
> > > 
> > > Is there an opportunity to get the document id?
> > 
> > It can't return null since the return type is 'int'. But assuming you
> > meant 0, that means the term isn't matching. The most likely cause is
> > you used a analyzer when first creating the document, which would have
> > altered the value of 'pathLC' to be something slightly different.
> > 
> > What analyzer did you pass to the IndexWriter? 
> > 
> > Also you shouldn't rely on the document ID because it is not fixed for a
> > given document. I believe it changes when you optimize the index.
> > 
> > 
> > 
> > 
> > -- 
> > Miles Barr <mi...@runtime-collective.com>
> > Runtime Collective Ltd.
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 

-- 
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


Re: UpdateIndex

Posted by Derya Kasapoglu <do...@gmx.de>.
I meant the reader.hasDeletions() returns null and reader.delete(term)
returns 0.

So...!
I store the path that way in the index:
document.add(Field.Text("pathLC", file[i].getAbsolutePath()));
and i use the StandardAnalyzer.
I can not search for the path if i store it as Keyword like that:
document.add(Field.Keyword("pathLC",
file[i].getAbsolutePath().toLowerCase()));
so i store it as a Text!!!

so i think i have to use the analyzer bevor i call delete(term) ?
i'm right? 


> --- Ursprüngliche Nachricht ---
> Von: Miles Barr <mi...@runtime-collective.com>
> An: java-user@lucene.apache.org
> Betreff: Re: UpdateIndex
> Datum: Tue, 23 Aug 2005 12:09:07 +0100
> 
> On Tue, 2005-08-23 at 12:54 +0200, Derya Kasapoglu wrote:
> > Yes, it returns null.
> > But this is a little bit funny because the searching is correct
> > and it finds the document whitch have changed!
> > So want can i do!?
> > 
> > Is there an opportunity to get the document id?
> 
> It can't return null since the return type is 'int'. But assuming you
> meant 0, that means the term isn't matching. The most likely cause is
> you used a analyzer when first creating the document, which would have
> altered the value of 'pathLC' to be something slightly different.
> 
> What analyzer did you pass to the IndexWriter? 
> 
> Also you shouldn't rely on the document ID because it is not fixed for a
> given document. I believe it changes when you optimize the index.
> 
> 
> 
> 
> -- 
> Miles Barr <mi...@runtime-collective.com>
> Runtime Collective Ltd.
> 
> 
> ---------------------------------------------------------------------
> 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


Re: UpdateIndex

Posted by Miles Barr <mi...@runtime-collective.com>.
On Tue, 2005-08-23 at 12:54 +0200, Derya Kasapoglu wrote:
> Yes, it returns null.
> But this is a little bit funny because the searching is correct
> and it finds the document whitch have changed!
> So want can i do!?
> 
> Is there an opportunity to get the document id?

It can't return null since the return type is 'int'. But assuming you
meant 0, that means the term isn't matching. The most likely cause is
you used a analyzer when first creating the document, which would have
altered the value of 'pathLC' to be something slightly different.

What analyzer did you pass to the IndexWriter? 

Also you shouldn't rely on the document ID because it is not fixed for a
given document. I believe it changes when you optimize the index.




-- 
Miles Barr <mi...@runtime-collective.com>
Runtime Collective Ltd.


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


Re: UpdateIndex

Posted by Derya Kasapoglu <do...@gmx.de>.
Yes, it returns null.
But this is a little bit funny because the searching is correct
and it finds the document whitch have changed!
So want can i do!?

Is there an opportunity to get the document id?


> --- Ursprüngliche Nachricht ---
> Von: Miles Barr <mi...@runtime-collective.com>
> An: java-user@lucene.apache.org
> Betreff: Re: UpdateIndex
> Datum: Tue, 23 Aug 2005 11:47:22 +0100
> 
> On Tue, 2005-08-23 at 12:38 +0200, Derya Kasapoglu wrote:
> > i query the index for the path of the files in the directory and compare
> the
> > dates.
> > But i have a Problem!
> > I find out the files which have changed but i can not delete the documet
> > from the index, i don't know why!
> > 
> > In the Field "pathLC" is he path of documnts in lower case.
> > Term term = new Term("pathLC", file[i].getAbsolutePath().toLowerCase());
> > delete(Term);
> > 
> > Than i close the IndexReader!!!
> > 
> > But i can still searching for the file which sould be deleted.
> 
> When you call IndexReader#delete(Term) what value is returned? It should
> return the number of matching documents it has deleted.
> 
> If this value is 0, then your term is incorrect.
> 
> 
> -- 
> Miles Barr <mi...@runtime-collective.com>
> Runtime Collective Ltd.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

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


Re: UpdateIndex

Posted by Miles Barr <mi...@runtime-collective.com>.
On Tue, 2005-08-23 at 12:38 +0200, Derya Kasapoglu wrote:
> i query the index for the path of the files in the directory and compare the
> dates.
> But i have a Problem!
> I find out the files which have changed but i can not delete the documet
> from the index, i don't know why!
> 
> In the Field "pathLC" is he path of documnts in lower case.
> Term term = new Term("pathLC", file[i].getAbsolutePath().toLowerCase());
> delete(Term);
> 
> Than i close the IndexReader!!!
> 
> But i can still searching for the file which sould be deleted.

When you call IndexReader#delete(Term) what value is returned? It should
return the number of matching documents it has deleted.

If this value is 0, then your term is incorrect.


-- 
Miles Barr <mi...@runtime-collective.com>
Runtime Collective Ltd.


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


Re: UpdateIndex

Posted by Derya Kasapoglu <do...@gmx.de>.
Hi,

i'm writing the deletion now and i do it that way:

i query the index for the path of the files in the directory and compare the
dates.
But i have a Problem!
I find out the files which have changed but i can not delete the documet
from the index, i don't know why!

In the Field "pathLC" is he path of documnts in lower case.
Term term = new Term("pathLC", file[i].getAbsolutePath().toLowerCase());
delete(Term);

Than i close the IndexReader!!!

But i can still searching for the file which sould be deleted.

Derya



> --- Ursprüngliche Nachricht ---
> Von: Ray Tsang <sa...@gmail.com>
 An: java-user@lucene.apache.org
 Betreff: Re: UpdateIndex
> Datum: Tue, 23 Aug 2005 09:48:59 +0800
> 
> This could be off topic, but I made something that updates indices
> that worked like the following, wonder if anybody has the same ideas? 
> I found something like IndexAccessControl in the mailing list before. 
> An implementation of the following uses IAC.
> 
> ManagedIndex index = ManagedIndex.getInstance(configuration); // could
> return different implemetnations of the ManagedIndex
> 
> Searcher searcher = index.getSearcher();  // could return different
> implementations of Searcher
> 
> ManagedUpdateSession session = index.beginUpdate();  // start a update
> session
> 
> session.addDocument(...); // use session to add, delete, update documents
> session.deleteDocument(...);
> session.updateDocument(...);
> 
> // lastly
> index.endUpdate(); // or.. session.commit()?  marks the end of the
> update sequence, refresh the searchers.
> 
> IndexReader, IndexWriter, indexSearcher would be managed, and there
> can be multiple implementations of how index is structured, e.g.
> RotatingIndex, AlternatingIndex, that rotates document updates to
> different indices.
> 
> Ray,
> 
> On 8/23/05, Otis Gospodnetic <ot...@yahoo.com> wrote:
> > Yes, this is not how you should do it.
> > Use reader.delete(Term) method to delete documents:
> >
>
http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexReader.html#delete(org.apache.lucene.index.Term)
> > 
> > Otis
> > 
> > --- dozean@gmx.de wrote:
> > 
> > > 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
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

-- 
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


Re: UpdateIndex

Posted by do...@gmx.de.
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


Re: UpdateIndex

Posted by Brian <ok...@yahoo.com>.
Would you want to update, or could you just append to
an existing Index?
Thanks, B

--- Ray Tsang <sa...@gmail.com> wrote:

> This could be off topic, but I made something that
> updates indices
> that worked like the following, wonder if anybody
> has the same ideas? 
> I found something like IndexAccessControl in the
> mailing list before. 
> An implementation of the following uses IAC.
> 
> ManagedIndex index =
> ManagedIndex.getInstance(configuration); // could
> return different implemetnations of the ManagedIndex
> 
> Searcher searcher = index.getSearcher();  // could
> return different
> implementations of Searcher
> 
> ManagedUpdateSession session = index.beginUpdate(); 
> // start a update session
> 
> session.addDocument(...); // use session to add,
> delete, update documents
> session.deleteDocument(...);
> session.updateDocument(...);
> 
> // lastly
> index.endUpdate(); // or.. session.commit()?  marks
> the end of the
> update sequence, refresh the searchers.
> 
> IndexReader, IndexWriter, indexSearcher would be
> managed, and there
> can be multiple implementations of how index is
> structured, e.g.
> RotatingIndex, AlternatingIndex, that rotates
> document updates to
> different indices.
> 
> Ray,
> 
> On 8/23/05, Otis Gospodnetic
> <ot...@yahoo.com> wrote:
> > Yes, this is not how you should do it.
> > Use reader.delete(Term) method to delete
> documents:
> >
>
http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexReader.html#delete(org.apache.lucene.index.Term)
> > 
> > Otis
> > 
> > --- dozean@gmx.de wrote:
> > 
> > > 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
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail:
> java-user-help@lucene.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: UpdateIndex

Posted by Ray Tsang <sa...@gmail.com>.
This could be off topic, but I made something that updates indices
that worked like the following, wonder if anybody has the same ideas? 
I found something like IndexAccessControl in the mailing list before. 
An implementation of the following uses IAC.

ManagedIndex index = ManagedIndex.getInstance(configuration); // could
return different implemetnations of the ManagedIndex

Searcher searcher = index.getSearcher();  // could return different
implementations of Searcher

ManagedUpdateSession session = index.beginUpdate();  // start a update session

session.addDocument(...); // use session to add, delete, update documents
session.deleteDocument(...);
session.updateDocument(...);

// lastly
index.endUpdate(); // or.. session.commit()?  marks the end of the
update sequence, refresh the searchers.

IndexReader, IndexWriter, indexSearcher would be managed, and there
can be multiple implementations of how index is structured, e.g.
RotatingIndex, AlternatingIndex, that rotates document updates to
different indices.

Ray,

On 8/23/05, Otis Gospodnetic <ot...@yahoo.com> wrote:
> Yes, this is not how you should do it.
> Use reader.delete(Term) method to delete documents:
> http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexReader.html#delete(org.apache.lucene.index.Term)
> 
> Otis
> 
> --- dozean@gmx.de wrote:
> 
> > 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
> 
>

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


Re: UpdateIndex

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Yes, this is not how you should do it.
Use reader.delete(Term) method to delete documents:
http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexReader.html#delete(org.apache.lucene.index.Term)

Otis

--- dozean@gmx.de wrote:

> 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