Class DefaultSolrSearchFieldContributor

  • All Implemented Interfaces:
    SolrQueryContributor, org.springframework.core.Ordered

    public class DefaultSolrSearchFieldContributor
    extends AbstractSolrQueryContributor
    Sets Solr's "fl" value to designate which fields should be returned in a search response.
    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSolrSearchFieldContributor​(com.broadleafcommerce.search.provider.solr.SolrFieldService solrFieldService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void contributeInternal​(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 provided solrQuery with some additional behavior.
      boolean contributeOnTypeAhead()
      TypeAhead handles its own search fields, so we don't contribute.
      protected List<com.broadleafcommerce.search.api.domain.FieldVariant> filterIncludeInResponseVariants​(List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions)  
      protected com.broadleafcommerce.search.provider.solr.SolrFieldService getSolrFieldService()  
      protected boolean shouldContribute​(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, org.springframework.data.domain.Pageable page, com.broadleafcommerce.search.core.service.SearchRequestProperties properties, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Determines if this contributor should run.
    • Constructor Detail

      • DefaultSolrSearchFieldContributor

        public DefaultSolrSearchFieldContributor​(com.broadleafcommerce.search.provider.solr.SolrFieldService solrFieldService)
    • Method Detail

      • contributeInternal

        protected void contributeInternal​(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 class: AbstractSolrQueryContributor
        Customize the provided solrQuery with some additional behavior.
        Specified by:
        contributeInternal in class AbstractSolrQueryContributor
        Parameters:
        solrQuery - The query to customize
        searchRequest - The search query request
        fieldDefinitions - The fields to perform the search on
        page - Page information for page to retrieve for query
        properties - Additional properties for this query
        locale - The locale of this search
        context - The context information surrounding sandboxing/multitenant state
      • filterIncludeInResponseVariants

        protected List<com.broadleafcommerce.search.api.domain.FieldVariant> filterIncludeInResponseVariants​(List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions)
      • shouldContribute

        protected boolean shouldContribute​(org.apache.solr.client.solrj.SolrQuery solrQuery,
                                           com.broadleafcommerce.search.api.domain.SearchRequest searchRequest,
                                           org.springframework.data.domain.Pageable page,
                                           com.broadleafcommerce.search.core.service.SearchRequestProperties properties,
                                           @Nullable
                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from class: AbstractSolrQueryContributor
        Determines if this contributor should run.
        Specified by:
        shouldContribute in class AbstractSolrQueryContributor
        Parameters:
        solrQuery - The query to customize
        searchRequest - The search query request
        page - Page information for page to retrieve for query
        properties - Additional properties for this query.
        context - The context information surrounding sandboxing/multitenant state
        Returns:
        whether this contributor should run
      • contributeOnTypeAhead

        public boolean contributeOnTypeAhead()
        TypeAhead handles its own search fields, so we don't contribute.
        Returns:
        Should this contributor be executed on TypeAhead requests?
      • getSolrFieldService

        protected com.broadleafcommerce.search.provider.solr.SolrFieldService getSolrFieldService()