lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane James Vaucher <vauch...@cirano.qc.ca>
Subject Re: updating the index created for database search
Date Mon, 26 Jul 2004 13:09:26 GMT
Firstly, please do not double-post, other comments inline:

On Mon, 26 Jul 2004, lingaraju wrote:

> Dear  All
> 
> I need  help  to  update the index created for the database search
> 
> I created the index with  three field  mapping to the three column of database(oid(primarykey),title,
contents)
> Then I created the document for each row and added to the writer      
> 
>     doc.add(Field.Keyword("OID",oid+""));
>     doc.add(Field.Text("title",title));
>     doc.add(Field.Text("contents",contents));
>     writer.addDocument(doc);
> 
> Here search is only on  title and the contents and oid is the key to retrieve the details
from the database.
> 
> Later if the "contents" column in the database is  updated. We have to updated the content
in the index also
> 
> If I use the writer with false
> 
> IndexWriter writer = new IndexWriter("C\index", new StandardAnalyzer(),false);
> 
> then all the record are inserted in to index without deleting the old index causing duplication

It's a question of efficiency. The procedure for doing updates is 
described here:

http://wiki.apache.org/jakarta-lucene/UpdatingAnIndex

In a nutshell, it's up to you to decide when a record is modified and 
needs to be removed, then readded (there is no update)

> If I use the writer with true
> 
> IndexWriter writer = new IndexWriter("C\index", new StandardAnalyzer(),false);
> 
> then record are inserted in to index deleting all the old index.
> 
> My question is 
> 1) How to update the existing index 
> 2) When I fetch the rows from the database in order to update or insert in index how
to know which record is modified in database and which record is not present is index
> 
> Thanks is advance
> Raju
> 

sv


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


Mime
View raw message