code: public void dispose(){
          // acquire status lock
          synchronized(statusLock){
              // abort if already disposed
              if(status == SearchStatus.DISPOSED){
                  return;
              }
              // assert idle
              assertIdle("Cannot dispose search.");
              // all good, handle disposed
              searchDisposed();
              // log
              LOGGER.debug("Search {} changed status: {} --> {}", this, status, SearchStatus.DISPOSED);
              // update status
              status = SearchStatus.DISPOSED;
              // fire status update
              fireStatusChanged(status);
          }
      }
docs: Dispose this search, upon which all of its resources are released. Note that only idle
  searches may be disposed and that a disposed search can never be restarted. Sets the search
  status to {@link SearchStatus#DISPOSED}. When trying to dispose an already disposed search,
  nothing happens, i.e. calling this method on a disposed search has no effect.
  
  @throws SearchException if the search is currently not idle (and not already disposed)