lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@intrafind.de>
Subject Re: updating the index created for database search
Date Mon, 26 Jul 2004 10:05:47 GMT
On Monday 26 July 2004 11:37, lingaraju wrote:

> 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

Your database will need a "last modified" column. Then you can select those 
rows that have been modified since the last update and for each row check if 
it's in the Lucene index. If it is, delete it there and re-add the new 
version. If it's not, add it. To delete documents you will probably need to 
iterate over all your IDs in the Lucene index and check if they are still in 
the database. If that's too inefficient you could check if you can do it the 
way the file system indexer (IndexHTML in Lucene's demo) does it.

BTW, please don't cross-post to both lists.

Regards
 Daniel
 
-- 
Daniel Naber, IntraFind Software AG, Tel. 089-8906 9700


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