Class RSQLSolrQueryContributor
java.lang.Object
com.broadleafcommerce.search.provider.solr.RSQLSolrQueryContributor
- All Implemented Interfaces:
SolrQueryContributor,org.springframework.core.Ordered
This contributor converts RSQL parameters into filter queries that solr understands.
This is also used for type-ahead requests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThis is the default name of the Category filter.protected static final intFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRSQLSolrQueryContributor(SolrRSQLFilterBuilder rsqlFilterBuilder, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> filterParser) -
Method Summary
Modifier and TypeMethodDescriptionvoidcontribute(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, com.broadleafcommerce.search.core.service.SearchRequestProperties properties, String locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Customize the providedsolrQuerywith some additional behavior.booleanprotected StringgetCategoryProductMembershipFilter(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, String locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>protected com.broadleafcommerce.search.core.service.locale.LocaleHelperintgetOrder()Default Spring Bean ordering.protected SolrRSQLFilterBuildervoidsetLocaleHelper(com.broadleafcommerce.search.core.service.locale.LocaleHelper localeHelper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.search.provider.solr.SolrQueryContributor
isTypeAheadRequest
-
Field Details
-
DEFAULT_PRECEDENCE
protected static final int DEFAULT_PRECEDENCE- See Also:
-
CATEGORY_IDS_FILTER_NAME
This is the default name of the Category filter.- See Also:
-
-
Constructor Details
-
RSQLSolrQueryContributor
public RSQLSolrQueryContributor(SolrRSQLFilterBuilder rsqlFilterBuilder, @NonNull com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> filterParser)
-
-
Method Details
-
contribute
public void contribute(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, com.broadleafcommerce.search.core.service.SearchRequestProperties properties, @Nullable String locale, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:SolrQueryContributorCustomize the providedsolrQuerywith some additional behavior.- Specified by:
contributein interfaceSolrQueryContributor- Parameters:
solrQuery- The query to customizesearchRequest- The search query requestfieldDefinitions- The fields to perform the search onpage- Page information for page to retrieve for queryproperties- Additional properties for this searchlocale- (optional) the locale of the querycontext- The context information surrounding sandboxing/multitenant state
-
getCategoryProductMembershipFilter
@Nullable protected String getCategoryProductMembershipFilter(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, @Nullable String locale, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getOrder
public int getOrder()Description copied from interface:SolrQueryContributorDefault Spring Bean ordering.- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Specified by:
getOrderin interfaceSolrQueryContributor
-
contributeOnTypeAhead
public boolean contributeOnTypeAhead()- Specified by:
contributeOnTypeAheadin interfaceSolrQueryContributor- Returns:
- Should this contributor be executed on TypeAhead requests?
-
getRsqlFilterBuilder
-
getFilterParser
@NonNull protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getFilterParser() -
getLocaleHelper
protected com.broadleafcommerce.search.core.service.locale.LocaleHelper getLocaleHelper() -
setLocaleHelper
@Autowired public void setLocaleHelper(com.broadleafcommerce.search.core.service.locale.LocaleHelper localeHelper)
-