code: public static final CmsSolrIndex getIndexSolr(CmsObject cms, Map<String, String[]> params) {
  
          String indexName = null;
          CmsSolrIndex index = null;
          // try to get the index name from the parameters: 'core' or 'index'
          if (params != null) {
              indexName = params.get(OpenCmsSolrHandler.PARAM_CORE) != null
              ? params.get(OpenCmsSolrHandler.PARAM_CORE)[0]
              : (params.get(OpenCmsSolrHandler.PARAM_INDEX) != null
              ? params.get(OpenCmsSolrHandler.PARAM_INDEX)[0]
              : null);
          }
          if (indexName == null) {
              // if no parameter is specified try to use the default online/offline indexes by context
              indexName = cms.getRequestContext().getCurrentProject().isOnlineProject()
              ? CmsSolrIndex.DEFAULT_INDEX_NAME_ONLINE
              : CmsSolrIndex.DEFAULT_INDEX_NAME_OFFLINE;
          }
          // try to get the index
          index = indexName != null ? OpenCms.getSearchManager().getIndexSolr(indexName) : null;
          if (index == null) {
              // if there is exactly one index, a missing core / index parameter doesn't matter, since there is no choice.
              List<CmsSolrIndex> solrs = OpenCms.getSearchManager().getAllSolrIndexes();
              if ((solrs != null) && !solrs.isEmpty() && (solrs.size() == 1)) {
                  index = solrs.get(0);
              }
          }
          return index;
      }
docs: Returns the Solr index configured with the parameters name.
  The parameters must contain a key/value pair with an existing
  Solr index, otherwise <code>null</code> is returned.<p>
  
  @param cms the current context
  @param params the parameter map
  
  @return the best matching Solr index