code: public String launch(CmsObject cms, Map<String, String> parameters) throws Exception {
  
          CmsSearchManager manager = OpenCms.getSearchManager();
  
          I_CmsReport report = null;
          boolean writeLog = Boolean.valueOf(parameters.get(JOB_PARAM_WRITELOG)).booleanValue();
  
          if (writeLog) {
              report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsSearchManager.class);
          }
  
          List<String> updateList = null;
          String indexList = parameters.get(JOB_PARAM_INDEXLIST);
          if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(indexList)) {
              // index list has been provided as job parameter
              updateList = new ArrayList<String>();
              String[] indexNames = CmsStringUtil.splitAsArray(indexList, '|');
              for (int i = 0; i < indexNames.length; i++) {
                  // check if the index actually exists
                  if (manager.getIndex(indexNames[i]) != null) {
                      updateList.add(indexNames[i]);
                  } else {
                      if (LOG.isWarnEnabled()) {
                          LOG.warn(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_WITH_NAME_1, indexNames[i]));
                      }
                  }
              }
          }
  
          long startTime = System.currentTimeMillis();
  
          if (updateList == null) {
              // all indexes need to be updated
              manager.rebuildAllIndexes(report);
          } else {
              // rebuild only the selected indexes
              manager.rebuildIndexes(updateList, report);
          }
  
          long runTime = System.currentTimeMillis() - startTime;
  
          String finishMessage = Messages.get().getBundle().key(
              Messages.LOG_REBUILD_INDEXES_FINISHED_1,
              CmsStringUtil.formatRuntime(runTime));
  
          if (LOG.isInfoEnabled()) {
              LOG.info(finishMessage);
          }
          return finishMessage;
      }
docs: Updates the indexes from as a scheduled job.<p>
  
  @param cms the OpenCms user context to use when reading resources from the VFS
  @param parameters the parameters for the scheduled job
  
  @throws Exception if something goes wrong
  
  @return the String to write in the scheduler log
  
  @see org.opencms.scheduler.I_CmsScheduledJob#launch(CmsObject, Map)