Jan 27, 2006, 1:40 PM
Post #9 of 10
(18798 views)
Permalink
Looks OK to me. Only thing I question is
reader = reader.open(dir);
This should an IndexReader.
reader = IndexReader.open(dir)
Charles Sanders
-----Original Message-----
From: Kodumuri, Madhavi [mailto:MKodumuri@cme.com]
Sent: Friday, January 27, 2006 4:27 PM
To: general@lucene.apache.org
Subject: RE: updating Lucene Index
I tried doing this, but I guess I am doing something wrong. This is my
snippet, can you please let me know what I was doing wrong.
Index_path is the path for the index database url is the one of the
Field in my Documents I added,
Directory dir = FSDirectory.getDirectory(index_path, false);
reader = reader.open(dir);
if (reader != null) {
reader.open(index_path);
String tempUrl = ServerName + url;
Term term = new Term("url",tempUrl);
reader.delete(term);
}
Thanks in advance,
Madhavi
-----Original Message-----
From: Fredrik Andersson [mailto:fidde.andersson@gmail.com]
Sent: Thursday, January 26, 2006 2:28 PM
To: general@lucene.apache.org
Subject: Re: updating Lucene Index
You can delete by any unique term, using an IndexReader. I think this
method is wrapped in IndexModifier as well, not sure. If it isn't, just
use an IndexReader.
yourIndexReader.delete(new Term("yourUniqueField", "yourUniqueValue"));
Fredrik
On 1/26/06, Kodumuri, Madhavi <MKodumuri@cme.com> wrote:
>
> How do I delete a document from the already existing indexer, as I am
> unable to get the indexed ID for that document.
>
> Thanks for your help,
>
> Madhavi
>
>
> -----Original Message-----
> From: Koji Sekiguchi [mailto:koji.sekiguchi@m4.dion.ne.jp]
> Sent: Tuesday, January 24, 2006 4:04 PM
> To: general@lucene.apache.org
> Subject: RE: updating Lucene Index
>
> even if you use IndexModifier class,
> you should delete then addDoc the document to be updated.
>
> Thanks,
>
> Koji
>
> > -----Original Message-----
> > From: Fredrik Andersson [mailto:fidde.andersson@gmail.com]
> > Sent: Wednesday, January 25, 2006 6:58 AM
> > To: general@lucene.apache.org
> > Subject: Re: updating Lucene Index
> >
> >
> > Hi,
> >
> > Use the IndexModifier class?
> >
> > On 1/24/06, Kodumuri, Madhavi <MKodumuri@cme.com> wrote:
> > >
> > > Hi,
> > >
> > > My Lucene Indexer indexes from scratch with no problem. But I
would
> like
> > > to update the index database next time I run Indexer rather than
> > > deleting the database and creating index from scratch every time I
> run
> > > the Indexer. Is there any Update methods?
> > > Any help appreciated,
> > >
> > > Thanks,
> > >
> > > Madhavi Kodumuri
> > >
> > >
> > >
> >
>
>
>