Interface QuerySearchPostProcessor


  • @ConsumerType
    public interface QuerySearchPostProcessor
    This interface provides a hook that allows consumer code manipulate the results of the QuerySearchProviderImpl prior to their return. This is especially useful to populating the `getAdditionalData()` map. To use this interface, create an OSGi Service consumer implementation of this interface.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Results process​(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.search.Query query, Results results, com.day.cq.search.result.SearchResult searchResult)
      This method provides a hook into processing query parameters immediately prior to querying.
    • Method Detail

      • process

        Results process​(org.apache.sling.api.SlingHttpServletRequest request,
                        com.day.cq.search.Query query,
                        Results results,
                        com.day.cq.search.result.SearchResult searchResult)
        This method provides a hook into processing query parameters immediately prior to querying. This method must return an object that implements the Results interface. A common use of this method is to populate the results.getAdditionalData() map results.getAdditionalData().put("customKey", createSomeCustomObject(..)); return results;
        Parameters:
        request - the SlingHttpServletRequest object that initiates this search.
        query - the QueryBuilder query executed to generate the results and searchResult.
        results - the results as created by QuerySearchProviderImpl
        searchResult - the "raw" QueryBuilder SearchResult object.
        Returns:
        the adjusted results object (may be a brand new Results obj).