title: Java Lucene NRT search not working
body: <p>Playing around with Lucene. Trying to make my changes visible for other reading threads. Without rebuilding index. For that purpose i use SearcherManager class.</p>
  
  <p>Creation of manager</p>
  
  <pre><code>Directory index = new SimpleFSDirectory(new File(LUCENE_INDEX_PATH));
  w = new IndexWriter(index, config);
  indexReader = IndexReader.open(w, true);
  manager = new SearcherManager(w, true, null, null);
  </code></pre>
  
  <p>Update request</p>
  
  <pre><code>w.updateDocument(t, document);
  manager.maybeReopen(); // openIfChanged same behavior
  w.commit();
  </code></pre>
  
  <p>Search request</p>
  
  <pre><code>IndexSearcher searcher = manager.acquire();
  try {
      return performSearch(query, searcher, skip, limit);
  } finally {
      manager.release(searcher);
      searcher = null;
  }
  </code></pre>
  
  <p>Changes are flushed to disc, but new search request see them only after application restart (recreation of index). Looks like IndexSearcher  still point to old Index. </p>