How can I get DocId when adding a document in Lucene index?

Posted by Rohit on Stack Overflow See other posts from Stack Overflow or by Rohit
Published on 2010-03-11T14:16:47Z Indexed on 2010/03/12 5:47 UTC
Read the original article Hit count: 218

Filed under:
|

I am indexing a row of data from database in Lucene.Net. A row is equivalent of Document.

I want to update my database with the DocId, so that I can use the DocId in the results to be able to retrieve rows quickly.

I currently first retrive the PK from the result docs which I think should be slower than retriving directly from the database using DocId.

How can I find the DocId when adding a document to Lucene?

© Stack Overflow or respective owner

Related posts about lucene

Related posts about lucene.net