Mailing List Archive

updating Lucene Index
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
Re: updating Lucene Index [ In reply to ]
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
>
>
>
RE: updating Lucene Index [ In reply to ]
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
> >
> >
> >
>
RE: updating Lucene Index [ In reply to ]
You mean, whenever I have updated the document which is already indexed
have to be deleted first from the index database and then add that
document to my indexer.

Thanks,

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
> >
> >
> >
>
RE: updating Lucene Index [ In reply to ]
I mean what you said.
Sorry for my lack of explanation.

Many thanks,

Koji
RE: updating Lucene Index [ In reply to ]
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
> >
> >
> >
>
Re: updating Lucene Index [ In reply to ]
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
> > >
> > >
> > >
> >
>
>
>
RE: updating Lucene Index [ In reply to ]
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
> > >
> > >
> > >
> >
>
>
>
RE: updating Lucene Index [ In reply to ]
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
> > >
> > >
> > >
> >
>
>
>
Re: updating Lucene Index [ In reply to ]
I haven't followed the whole thread, but this looks weird:

reader = reader.open(dir);
if (reader != null) {
reader.open(index_path);

reader.open called twice? Why?

Also, you'll get more help on java-user@lucene... list.

Otis

----- Original Message ----
From: "Kodumuri, Madhavi" <MKodumuri@cme.com>
To: general@lucene.apache.org
Sent: Fri 27 Jan 2006 04:26:44 PM EST
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
> > >
> > >
> > >
> >
>
>
>