Hi Marc,

You can't depend on Lucene's internal ID, it will change every time when you
update the index -- this is something you can't control.  The way you are
currently doing it, by storing an ID in a field named "id" is the right way
to do it.  Don't worry about slowing down Lucene if you call the API to get
the ID of your field "id".  Lucene is supper fast.

Regards,

-- George Aroush 

-----Original Message-----
From: Kaufmann M. [mailto:[EMAIL PROTECTED]
Sent: Friday, October 27, 2006 4:20 PM
To: [email protected]
Subject: Storing primary key / Change lucene's document ID

Hello everybody,
I've got a little question concerning the unique ID stored in the Lucene
index (hits.ID(i)).
Is it possible to change this ID, or set it on doc.add?

Currently I'm running a test-project wich stores an external primary key in
a field named 'id', but if I call it from the search-engine I have to use
the get-method - wich slows it down.
If I could use this primary key as lucene-ID the whole engine would be a lot
faster because I just need the ID's returned...

Does anybody know if this is possible?

Thanks!
Best Regards, Marc

Reply via email to