lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahaveer jain <jainmahavee...@yahoo.com>
Subject Re: Deleting index for DB indexing
Date Fri, 31 Dec 2004 05:17:48 GMT
Thanks Paul,
 
You idea seems to be good. I ll try that. I have one more question. Should the new key what
I create have to be keyword ? or Can it be just a column in the index ?
 
Mahaveer

Paul <paul.fuehring@gmail.com> wrote:
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 :)

Paul

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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message