lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul <>
Subject Re: Deleting index for DB indexing
Date Thu, 30 Dec 2004 22:46:52 GMT
On Thu, 30 Dec 2004 08:36:04 -0800 (PST), mahaveer jain
<> wrote:
> I am indexing more that 5 tables. And each for them have autoincrement and
> that is the primary key. So if I do find DocNum, it may so happen that it
> may delete document I don't want to delete. 

you need to create your own global ID, I had the same problem (but I
used a MD5 hashvalue). One solution ist to give each of your tables an
internal number and when creating your lucene-documents you add an
additional field with something like "dbInternalId*100+dbNumber" so
that db-record 5 in table 3 results in 503. when documents from your
DB are deleted and you need to update the index you simple create a
term which's value is calculated the same way and delete the document
with the IndexReader.delete(Term)
Instead of calculating you can do string concatenating as well :)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message