I am using Lucene to store (as well as index) various documents.
Each document needs a persistent unique identifier (to be used as part of a URL).
If I was using a SQL database, I could use an integer primary key auto_increment
(or similar) field to automatically generate a unique id for every record that was added.
Is there any way of doing this with Lucene?
I am aware that documents in Lucene are numbered, but have noted that these numbers are reallocated over time.
(I'm using the Java version of Lucene 3.0.3.)