docs: @SuppressWarnings("unchecked")
      @EventMapping(SearchConstants.SEARCH_REQUEST_QNAME_STRING)
      public void handleSearchRequest(EventRequest request, EventResponse response) {
          // UP-3887 Design flaw.  Both the searchLauncher portlet instance and the search portlet
          // instance receive
          // searchRequest and searchResult events because they are in the same portlet code base (to
          // share
          // autosuggest_handler.jsp and because we have to calculate the search portlet url for the
          // ajax call)
          // and share the portlet.xml which defines the event handling behavior.
          // If this instance is the searchLauncher, ignore the searchResult. The search was submitted
          // to the search
          // portlet instance.
          final String searchLaunchFname =
                  request.getPreferences().getValue(SEARCH_LAUNCH_FNAME, null);
          if (searchLaunchFname != null) {
              // Noisy in debug mode so commented out log statement
              // logger.debug("SearchLauncher does not participate in SearchRequest events so
              // discarding message");
              return;
          }
  
          final Event event = request.getEvent();
          final SearchRequest searchQuery = (SearchRequest) event.getValue();
  
          // Map used to track searches that have been handled, used so that one search doesn't get
          // duplicate results
          ConcurrentMap<String, Boolean> searchHandledCache;
          final PortletSession session = request.getPortletSession();
          synchronized (org.springframework.web.portlet.util.PortletUtils.getSessionMutex(session)) {
              searchHandledCache =
                      (ConcurrentMap<String, Boolean>)
                              session.getAttribute(
                                      SEARCH_HANDLED_CACHE_NAME, PortletSession.APPLICATION_SCOPE);
              if (searchHandledCache == null) {
                  searchHandledCache =
                          CacheBuilder.newBuilder()
                                  .maximumSize(20)
                                  .expireAfterAccess(5, TimeUnit.MINUTES)
                                  .<String, Boolean>build()
                                  .asMap();
                  session.setAttribute(
                          SEARCH_HANDLED_CACHE_NAME,
                          searchHandledCache,
                          PortletSession.APPLICATION_SCOPE);
              }
          }
  
          final String queryId = searchQuery.getQueryId();
          if (searchHandledCache.putIfAbsent(queryId, Boolean.TRUE) != null) {
              // Already handled this search request
              return;
          }
  
          // Create the results
          final SearchResults results = new SearchResults();
          results.setQueryId(queryId);
          results.setWindowId(request.getWindowID());
          final List<SearchResult> searchResultList = results.getSearchResult();
  
          // Run the search for each service appending the results
          for (IPortalSearchService searchService : searchServices) {
              try {
                  logger.debug(
                          "For queryId {}, query '{}', searching search service {}",
                          queryId,
                          searchQuery.getSearchTerms(),
                          searchService.getClass().toString());
                  final SearchResults serviceResults =
                          searchService.getSearchResults(request, searchQuery);
                  logger.debug(
                          "For queryId {}, obtained {} results from search service {}",
                          queryId,
                          serviceResults.getSearchResult().size(),
                          searchService.getClass().toString());
                  searchResultList.addAll(serviceResults.getSearchResult());
              } catch (Exception e) {
                  logger.warn(
                          searchService.getClass()
                                  + " threw an exception when searching, it will be ignored. "
                                  + searchQuery,
                          e);
              }
          }
  
          // Respond with a results event if results were found
          if (!searchResultList.isEmpty()) {
              response.setEvent(SearchConstants.SEARCH_RESULTS_QNAME, results);
          }
      }