docs: public String displaySearchResult(CmsSearch search) {
  
          StringBuffer result = new StringBuffer(800);
          Locale locale = m_jsp.getRequestContext().getLocale();
          CmsMessages messages = org.opencms.search.Messages.get().getBundle(locale);
  
          result.append("<h3>\n");
          result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_RESULT_TITLE_0));
          result.append("\n</h1>\n");
          List<CmsSearchResult> searchResult;
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(search.getQuery())) {
              search.setQuery("");
              searchResult = Collections.emptyList();
          } else {
              search.setMatchesPerPage(5);
              searchResult = search.getSearchResult();
          }
  
          HttpServletRequest request = m_jsp.getRequest();
          // get the action to perform from the request
          String action = request.getParameter("action");
  
          if ((action != null) && (searchResult == null)) {
              result.append("<p class=\"formerror\">\n");
              if (search.getLastException() != null) {
  
                  result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_UNAVAILABLE_0));
                  result.append("\n<!-- ").append(search.getLastException().toString());
                  result.append(" //-->\n");
              } else {
                  result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_NOMATCH_1, search.getQuery()));
                  result.append("\n");
              }
              result.append("</p>\n");
          } else if ((action != null) && (searchResult.size() <= 0)) {
              result.append("<p class=\"formerror\">\n");
              result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_NOMATCH_1, search.getQuery()));
              result.append("\n");
              result.append("</p>\n");
          } else if ((action != null) && (searchResult.size() > 0)) {
              result.append("<p>\n");
              result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_RESULT_START_0));
              result.append("\n");
              result.append("</p>\n<p>\n");
  
              Iterator<CmsSearchResult> iterator = searchResult.iterator();
  
              try {
                  if (m_exportLinks) {
                      m_jsp.getRequestContext().setCurrentProject(m_onlineProject);
                  }
  
                  String name;
                  String path;
                  while (iterator.hasNext()) {
                      CmsSearchResult entry = iterator.next();
                      result.append("\n<div class=\"searchResult\">");
                      result.append("<a class=\"navhelp\" href=\"#\" onclick=\"javascript:window.open('");
                      // CmsJspActionElement.link() is not programmed for using from root site
                      // because it assumes the "default CmsSite" when no configured site matches the
                      // root site "/":
                      if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_jsp.getRequestContext().getSiteRoot())) {
                          // link will always cut off "/sites/default" if we are in the
                          // root site, this call is only used to get the scheme, host, context name and servlet name...
                          path = m_jsp.link(OpenCms.getSiteManager().getDefaultSite().getSiteRoot() + "/")
                              + entry.getPath().substring(1);
                      } else {
                          path = m_jsp.link(entry.getPath());
                      }
                      result.append(path);
                      result.append(
                          "', '_blank', 'width='+screen.availWidth+', height='+ screen.availHeight+', scrollbars=yes, menubar=yes, toolbar=yes')\"");
                      result.append("\">\n");
                      name = entry.getField(CmsSearchField.FIELD_TITLE);
                      if (name == null) {
                          name = entry.getPath();
                      }
                      result.append(name);
                      result.append("</a>");
                      result.append("&nbsp;(").append(entry.getScore()).append("&nbsp;%)\n");
  
                      result.append("<span class=\"searchExcerpt\">\n");
                      String excerptString = entry.getExcerpt();
                      if (CmsStringUtil.isEmptyOrWhitespaceOnly(excerptString)) {
                          result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_EXCERPT_UNAVAILABLE_0));
                      } else {
                          result.append(excerptString).append('\n');
                      }
                      result.append("</span>\n");
                      result.append("</div>\n");
                  }
              } finally {
                  m_jsp.getRequestContext().setCurrentProject(m_offlineProject);
              }
  
              result.append("</p>\n");
  
              // search page links below results
              if ((search.getPreviousUrl() != null) || (search.getNextUrl() != null)) {
                  result.append("<p>");
                  if (search.getPreviousUrl() != null) {
  
                      result.append("<a class=\"searchlink\" href=\"");
                      result.append(
                          getSearchPageLink(
                              m_jsp.link(new StringBuffer(search.getPreviousUrl()).append('&').append(
                                  CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                      m_jsp.getRequestContext().getLocale()).toString()),
                              search));
                      result.append("\">");
                      result.append(messages.key(org.opencms.search.Messages.GUI_HELP_BUTTON_BACK_0));
                      result.append(" &lt;&lt;</a>&nbsp;&nbsp;\n");
                  }
                  Map<Integer, String> pageLinks = search.getPageLinks();
                  Iterator<Integer> i = pageLinks.keySet().iterator();
                  while (i.hasNext()) {
                      int pageNumber = (i.next()).intValue();
  
                      result.append(" ");
                      if (pageNumber != search.getSearchPage()) {
                          result.append("<a class=\"searchlink\" href=\"").append(
                              getSearchPageLink(
                                  m_jsp.link(new StringBuffer(pageLinks.get(new Integer(pageNumber))).append('&').append(
                                      CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                          m_jsp.getRequestContext().getLocale()).toString()),
                                  search));
                          result.append("\" target=\"_self\">").append(pageNumber).append("</a>\n");
                      } else {
                          result.append(pageNumber);
                      }
                  }
                  if (search.getNextUrl() != null) {
                      result.append("&nbsp;&nbsp;&nbsp;<a class=\"searchlink\" href=\"");
                      result.append(
                          getSearchPageLink(
                              new StringBuffer(m_jsp.link(search.getNextUrl())).append('&').append(
                                  CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                      m_jsp.getRequestContext().getLocale()).toString(),
                              search));
                      result.append("\">&gt;&gt;");
                      result.append(messages.key(org.opencms.search.Messages.GUI_HELP_BUTTON_NEXT_0));
                      result.append("</a>\n");
                  }
                  result.append("</p>\n");
              }
  
          }
  
          // include the post forms for the page links:
          Iterator<HTMLForm> values = m_formCache.values().iterator();
          while (values.hasNext()) {
              result.append(values.next());
          }
          return result.toString();
  
      }