Class SearchRedirectMatchService


  • public class SearchRedirectMatchService
    extends Object
    • Field Detail

      • searchRedirectService

        protected final SearchRedirectService<com.broadleafcommerce.search.api.domain.SearchRedirect> searchRedirectService
    • Constructor Detail

      • SearchRedirectMatchService

        public SearchRedirectMatchService​(SearchRedirectService<com.broadleafcommerce.search.api.domain.SearchRedirect> searchRedirectService,
                                          com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
    • Method Detail

      • findRedirect

        public Optional<com.broadleafcommerce.search.api.domain.SearchRedirect> findRedirect​(com.broadleafcommerce.search.api.domain.SearchRequest searchRequest,
                                                                                             @Nullable
                                                                                             com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Try to find SearchRedirect based on exact query match, or regex query match.
        Parameters:
        searchRequest - the search to find a redirect for
        contextInfo - The context information surrounding sandboxing/multitenant state
        Returns:
        the search redirect for the search request
      • getRedirectByRegexMatch

        protected Optional<com.broadleafcommerce.search.api.domain.SearchRedirect> getRedirectByRegexMatch​(@Nullable
                                                                                                           String query,
                                                                                                           @Nullable
                                                                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • getRegexSearchRedirectMap

        protected Map<Pattern,​com.broadleafcommerce.search.api.domain.SearchRedirect> getRegexSearchRedirectMap​(@Nullable
                                                                                                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Returns a map, with a pattern as the key, and the SearchRedirect for that pattern as the value. Provides caching mechanism for re-using compiled patterns when handling search redirects.
        Parameters:
        contextInfo -
        Returns: