code: public void commit() {
          Log.info("Committing");
          try {
              indexWriter.commit();
          } catch (IOException e) {
              Log.error(e, "Error while committing");
              throw new RuntimeException(e);
          }
      }
docs: Commits the pending changes.