code: public void setIndex(String indexName) {
  
          resetLastResult();
          if (CmsStringUtil.isNotEmpty(indexName)) {
              try {
                  I_CmsSearchIndex idx = OpenCms.getSearchManager().getIndex(indexName);
                  CmsSearchIndex index = idx instanceof CmsSearchIndex ? (CmsSearchIndex)idx : null;
                  if (index == null) {
                      throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName));
                  }
                  m_parameters.setSearchIndex(index);
              } catch (Exception exc) {
                  if (LOG.isDebugEnabled()) {
                      LOG.debug(Messages.get().getBundle().key(Messages.LOG_INDEX_ACCESS_FAILED_1, indexName), exc);
                  }
                  m_lastException = exc;
              }
          }
      }
docs: Set the name of the index to search.<p>
  
  A former search result will be deleted.<p>
  
  @param indexName the name of the index