I'm currently indexing a database with lucene. I was thinking of storing the table id in the index, but I can't find a way to retrieve the documents by that field. I guess some pseudo-code will further clarify the question:
document.add("_id", 7, Field.Index.UN_TOKENIZED, Field.Store.YES);
// How can I query the document with _id=7
// without getting the document with _id=17 or _id=71?