Class RelevancyRuleUtils<R extends com.broadleafcommerce.search.api.domain.RelevancyRule>

java.lang.Object
com.broadleafcommerce.search.core.service.relevancyrule.RelevancyRuleUtils<R>

public class RelevancyRuleUtils<R extends com.broadleafcommerce.search.api.domain.RelevancyRule> extends Object
  • Constructor Details

  • Method Details

    • lookupRelevancyRuleOptions

      public List<R> lookupRelevancyRuleOptions(@NonNull @NonNull com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, @NonNull @NonNull List<? extends com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Determines the RelevancyRules for the given FieldDefinitions and SearchRequest. If SearchSettings are enabled, then this will look up the SearchSettings first to find the appropriate settings for the application or tenant in context. Then it will perform a lookup based on the relevancy rules configured. Otherwise, it will simply continue since no rules can be setup for this context.

      This will use a copy of the given ContextInfo that has ContextInfo.isIgnoreCatalogNarrowing() set to true when reading search settings and related domain since the Catalog ID on the request will be for the indexable type being queried on not the Search Group the settings belong to.

      Parameters:
      searchRequest - Incoming search request
      fieldDefinitions - List of resolved FieldDefinitions appropriate for the indexable type.
      context - Additional sandbox and multitenant info.
      Returns:
      the list of relevancy rules for the provided context
    • determineRelevancyRulesForSearchRequest

      protected List<R> determineRelevancyRulesForSearchRequest(@NonNull @NonNull List<? extends com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, String indexableType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • determineAvailableRelevancyRulesForRelevancyRuleGroup

      protected List<R> determineAvailableRelevancyRulesForRelevancyRuleGroup(com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup settingsRelevancyRuleGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • determineSettingsRelevancyRuleGroup

      protected Optional<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup> determineSettingsRelevancyRuleGroup(com.broadleafcommerce.search.api.domain.SearchSettings searchSettings, String indexableType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getSearchSettingsUtils

      protected SearchSettingsUtils getSearchSettingsUtils()
    • getSettingsRelevancyRuleGroupService

      protected SettingsRelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup> getSettingsRelevancyRuleGroupService()
    • getRelevancyRuleGroupService

      protected RelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroup> getRelevancyRuleGroupService()
    • getRelevancyRuleGroupRuleService

      protected RelevancyRuleGroupRuleService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroupRule> getRelevancyRuleGroupRuleService()
    • getRelevancyRuleService

      protected RelevancyRuleService<R> getRelevancyRuleService()
    • getSearchSettingsProperties

      protected com.broadleafcommerce.search.autoconfigure.SearchSettingsProperties getSearchSettingsProperties()