title: How to update a Lucene.NET index?
body: <p>I'm developing a Desktop Search Engine in Visual Basic 9 (VS2008) using Lucene.NET (v2.0).</p>
  
  <p>I use the following code to initialize the IndexWriter</p>
  
  <pre><code>Private writer As IndexWriter
  
  writer = New IndexWriter(indexDirectory, New StandardAnalyzer(), False)
  
  writer.SetUseCompoundFile(True)
  </code></pre>
  
  <p>If I select the same document folder (containing files to be indexed) twice, two different entries for each file in that document folder are created in the index.</p>
  
  <p>I want the IndexWriter to discard any files that are already present in the Index.</p>
  
  <p>What should I do to ensure this?</p>