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 String
This is the default name of the Category filter.protected static final int
Fields 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 TypeMethodDescriptionvoid
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, String locale, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Customize the providedsolrQuery
with some additional behavior.boolean
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, 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.LocaleHelper
int
getOrder()
Default Spring Bean ordering.protected SolrRSQLFilterBuilder
void
setLocaleHelper
(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, wait
Methods 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:SolrQueryContributor
Customize the providedsolrQuery
with some additional behavior.- Specified by:
contribute
in 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:SolrQueryContributor
Default Spring Bean ordering.- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
- Specified by:
getOrder
in interfaceSolrQueryContributor
-
contributeOnTypeAhead
public boolean contributeOnTypeAhead()- Specified by:
contributeOnTypeAhead
in 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)
-