code: private String calculateAutocompleteResourceUrl(
              RenderRequest request, RenderResponse response) {
          final HttpServletRequest httpRequest =
                  this.portalRequestUtils.getPortletHttpRequest(request);
          final IPortalUrlBuilder portalUrlBuilder =
                  this.portalUrlProvider.getPortalUrlBuilderByPortletFName(
                          httpRequest, "search", UrlType.RESOURCE);
          final IPortletUrlBuilder portletUrlBuilder =
                  portalUrlBuilder.getPortletUrlBuilder(portalUrlBuilder.getTargetPortletWindowId());
          portletUrlBuilder.setResourceId(AJAX_RESPONSE_RESOURCE_ID);
          return portletUrlBuilder.getPortalUrlBuilder().getUrlString();
      }
docs: Create a resourceUrl for <code>AJAX_RESPONSE_RESOURCE_ID</code>. The resource URL is for the
  ajax typing search results response.
  
  @param request render request
  @param response render response