code: public void setIndexForProject(CmsObject cms) throws CmsException {
  
          setIndex(
              cms.getRequestContext().getCurrentProject().isOnlineProject()
              ? CmsSolrIndex.DEFAULT_INDEX_NAME_ONLINE
              : CmsSolrIndex.DEFAULT_INDEX_NAME_OFFLINE);
      }
docs: Sets the index name according to the current project.<p>
  
  @param cms the cms context
  
  @throws CmsException in case setting the index fails