code: public synchronized I_CmsSearchDocument getDocument(String fieldname, String term, String[] fls) {
  
          try {
              SolrQuery query = new SolrQuery();
              if (CmsSearchField.FIELD_PATH.equals(fieldname)) {
                  query.setQuery(fieldname + ":\"" + term + "\"");
              } else {
                  query.setQuery(fieldname + ":" + term);
              }
              query.addFilterQuery("{!collapse field=" + fieldname + "}");
              if (null != fls) {
                  query.setFields(fls);
              }
              QueryResponse res = m_solr.query(query);
              if (res != null) {
                  SolrDocumentList sdl = m_solr.query(query).getResults();
                  if ((sdl.getNumFound() > 0L) && (sdl.get(0) != null)) {
                      return new CmsSolrDocument(sdl.get(0));
                  }
              }
          } catch (Exception e) {
              // ignore and assume that the document could not be found
              LOG.error(e.getMessage(), e);
          }
          return null;
      }
docs: Version of {@link org.opencms.search.CmsSearchIndex#getDocument(java.lang.String, java.lang.String)} where
  the returned fields can be restricted.
  
  @param fieldname the field to query in
  @param term the query
  @param fls the returned fields.
  @return the document.