  @Test
  public void testUpdateIndex() throws IOException {

    System.setProperty("config.file", "src/test/resources/test.conf");
    ConfigFactory.invalidateCaches();

    String configId = "yiddish";
    JochreIndexBuilder builder = new JochreIndexBuilder(configId, false);
    builder.updateIndex();

    JochreSearchManager manager = JochreSearchManager.getInstance(configId);
    IndexSearcher indexSearcher = manager.getManager().acquire();
    try {
      JochreIndexSearcher searcher = new JochreIndexSearcher(indexSearcher, configId);
      Map<Integer, Document> docs = searcher.findDocuments("MotlPeysiDemKhazns");
      assertEquals(1, docs.size());
      int docId = docs.keySet().iterator().next();
      JochreIndexDocument jochreDoc = new JochreIndexDocument(indexSearcher, docId, configId);
      assertEquals("MotlPeysiDemKhazns", jochreDoc.getName());
      LOG.debug(jochreDoc.toString());

      JochreQuery query = new JochreQuery(configId, "זיך");
      Pair<TopDocs, Integer> results = searcher.search(query, 0, 100);
      assertEquals(1, results.getRight().intValue());
      for (ScoreDoc scoreDoc : results.getLeft().scoreDocs) {
        jochreDoc = new JochreIndexDocument(indexSearcher, scoreDoc.doc, configId);
        assertEquals("MotlPeysiDemKhazns", jochreDoc.getName());
      }
    } finally {
      manager.getManager().release(indexSearcher);
    }
  }