code: public void close()
      {
          try
          {
              if (w != null && readyForCommit)
              {
                  w.commit();
                  copy(index, FSDirectory.open(getIndexDirectory().toPath()));
              }
          }
  
          catch (Exception e)
          {
              log.error("Error while closing lucene indexes, Caused by: ", e);
              throw new LuceneIndexingException("Error while closing lucene indexes.", e);
          }
      }
docs: Close of transaction.