title: How to get internal doc id set by lucene
body: <p>I've indexed some documents in the index module. Intuitively, Lucene set <code>IDs</code> for any indexed document. These <code>IDs</code> may not have a specific order though. Concretely, the first doc ID is set to <code>127</code>, the second one is set to <code>133</code> and so on...</p>
  
  <p>In the search module, I have the document (which I want to process), But I'm trying to get these already-set <code>docIDs</code> (that was set by Lucene in index time) See the code below:</p>
  
  <pre><code>private long calculateProbabilityOfDocument(String topic, Document doc){   
  
    Terms termVector = iReader.getTermVector(DOCID, FIELD);
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I think Lucene may not let me access the internal IDs. Is there any other approach?</p>
  
  <p>Thanks in advance!</p>