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 Summary
ConstructorsConstructorDescriptionRelevancyRuleUtils
(SearchSettingsUtils searchSettingsUtils, SettingsRelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup> settingsRelevancyRuleGroupService, RelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroup> relevancyRuleGroupService, RelevancyRuleGroupRuleService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroupRule> relevancyRuleGroupRuleService, RelevancyRuleService<R> relevancyRuleService, com.broadleafcommerce.search.autoconfigure.SearchSettingsProperties searchSettingsProperties) -
Method Summary
Modifier and TypeMethodDescriptiondetermineAvailableRelevancyRulesForRelevancyRuleGroup
(com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup settingsRelevancyRuleGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) determineRelevancyRulesForSearchRequest
(@NonNull List<? extends com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, String indexableType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected Optional<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup>
determineSettingsRelevancyRuleGroup
(com.broadleafcommerce.search.api.domain.SearchSettings searchSettings, String indexableType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected RelevancyRuleGroupRuleService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroupRule>
protected RelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroup>
protected RelevancyRuleService<R>
protected com.broadleafcommerce.search.autoconfigure.SearchSettingsProperties
protected SearchSettingsUtils
protected SettingsRelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup>
lookupRelevancyRuleOptions
(@NonNull com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, @NonNull List<? extends com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Determines theRelevancyRules
for the givenFieldDefinitions
andSearchRequest
.
-
Constructor Details
-
RelevancyRuleUtils
public RelevancyRuleUtils(SearchSettingsUtils searchSettingsUtils, SettingsRelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.SettingsRelevancyRuleGroup> settingsRelevancyRuleGroupService, RelevancyRuleGroupService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroup> relevancyRuleGroupService, RelevancyRuleGroupRuleService<com.broadleafcommerce.search.api.domain.RelevancyRuleGroupRule> relevancyRuleGroupRuleService, RelevancyRuleService<R> relevancyRuleService, com.broadleafcommerce.search.autoconfigure.SearchSettingsProperties searchSettingsProperties)
-
-
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 theRelevancyRules
for the givenFieldDefinitions
andSearchRequest
. IfSearchSettings are enabled
, then this will look up theSearchSettings
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 hasContextInfo.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 requestfieldDefinitions
- List of resolvedFieldDefinitions
appropriate for the indexable type.context
- Additional sandbox and multitenant info.- Returns:
- the list of relevancy rules for the provided context
-
determineRelevancyRulesForSearchRequest
-
determineAvailableRelevancyRulesForRelevancyRuleGroup
-
determineSettingsRelevancyRuleGroup
-
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
-
getSearchSettingsProperties
protected com.broadleafcommerce.search.autoconfigure.SearchSettingsProperties getSearchSettingsProperties()
-