Class CatalogTrackableSolrDocumentBuilderContributor

  • All Implemented Interfaces:
    com.broadleafcommerce.search.index.core.document.DocumentBuilderContributor<org.apache.solr.common.SolrInputDocument>

    public class CatalogTrackableSolrDocumentBuilderContributor
    extends com.broadleafcommerce.search.index.common.document.TrackableDocumentBuilderContributor<org.apache.solr.common.SolrInputDocument>
    Contribute fields to the document for tracking its Catalog context.
    • Constructor Detail

      • CatalogTrackableSolrDocumentBuilderContributor

        public CatalogTrackableSolrDocumentBuilderContributor()
    • Method Detail

      • contributeTrackable

        public void contributeTrackable​(com.broadleafcommerce.search.api.domain.Indexable<?> indexable,
                                        org.apache.solr.common.SolrInputDocument document)
        Specified by:
        contributeTrackable in class com.broadleafcommerce.search.index.common.document.TrackableDocumentBuilderContributor<org.apache.solr.common.SolrInputDocument>
      • getCatalogId

        protected String getCatalogId​(@NonNull
                                      @NonNull com.broadleafcommerce.search.api.domain.CatalogTrackable catalogTrackable)
        Return the catalog ID to be set on this catalog trackable document. If ContextState.getOverrideCatalogId() is not empty, this is an overridden catalog trackable, and that value is returned. Otherwise, ContextState.getBaseCatalogId() is returned.
        Parameters:
        catalogTrackable - The catalog trackable.
        Returns:
        The catalog ID of the indexable.
      • getTrackableBehavior

        protected com.broadleafcommerce.data.tracking.core.TrackableBehavior getTrackableBehavior()
        Specified by:
        getTrackableBehavior in class com.broadleafcommerce.search.index.common.document.TrackableDocumentBuilderContributor<org.apache.solr.common.SolrInputDocument>