Interface SolrIndexServiceExtensionHandler

All Superinterfaces:
org.broadleafcommerce.common.extension.ExtensionHandler
All Known Implementing Classes:
AbstractSolrIndexServiceExtensionHandler, I18nSolrIndexServiceExtensionHandler

public interface SolrIndexServiceExtensionHandler extends org.broadleafcommerce.common.extension.ExtensionHandler
Extension handler for indexing operations in Solr. Implementors should extend from AbstractSolrIndexServiceExtensionHandler to protect from API changes to this interface
Author:
Phillip Verheyden (phillipuniverse)
  • Method Summary

    Modifier and Type
    Method
    Description
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    addPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String,Object> values, String propertyName, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
    Given the input field, populates the values array with the fields needed for the passed in field.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    attachAdditionalBasicFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document, SolrHelperService shs)
    Allows the extension additional fields to the document that are not configured via the DB.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    attachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document)
     
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    attachChildDocuments(Indexable indexable, org.apache.solr.common.SolrInputDocument document, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
    This extension point allows other modules to contribute child documents to this document.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    endBatchEvent(List<? extends Indexable> indexables)
    Perform actions to end a batch event, such as closing any Contexts that have been previously created.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    getCategoryId(Long category, Long[] returnContainer)
    In certain scenarios, the requested category id might not be the one that should be used in Solr.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    getIndexableId(Indexable indexable, Long[] returnContainer)
    In certain scenarios, the requested product id might not be the one that should be used in Solr.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    modifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> items, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
     
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    populateDocumentForIndexField(org.apache.solr.common.SolrInputDocument document, IndexField field, FieldType fieldType, Map<String,Object> propertyValues)
    This is used to populate any fields for the given parameters as well as adding any property names to the added properties list.
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    startBatchEvent(List<? extends Indexable> indexables)
    Perform actions at the start of a batch to improve performance of Solr search for the list of batch products.

    Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler

    getPriority, isEnabled
  • Method Details

    • getCategoryId

      org.broadleafcommerce.common.extension.ExtensionResultStatusType getCategoryId(Long category, Long[] returnContainer)
      In certain scenarios, the requested category id might not be the one that should be used in Solr. If this method returns ExtensionResultStatusType.HANDLED, the value placed in the 0th element in the returnContainer should be used.
      Parameters:
      category -
      returnContainer -
      Returns:
      the extension result status type
    • getIndexableId

      org.broadleafcommerce.common.extension.ExtensionResultStatusType getIndexableId(Indexable indexable, Long[] returnContainer)
      In certain scenarios, the requested product id might not be the one that should be used in Solr. If this method returns ExtensionResultStatusType.HANDLED, the value placed in the 0th element in the returnContainer should be used.
      Parameters:
      indexable -
      returnContainer -
      Returns:
      the extension result status type
    • modifyBuiltDocuments

      org.broadleafcommerce.common.extension.ExtensionResultStatusType modifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> items, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
    • startBatchEvent

      org.broadleafcommerce.common.extension.ExtensionResultStatusType startBatchEvent(List<? extends Indexable> indexables)
      Perform actions at the start of a batch to improve performance of Solr search for the list of batch products. For example we want to get, in bulk, the SkuPriceData for each product and save these in memory by default.
      Parameters:
      indexables -
      Returns:
    • endBatchEvent

      org.broadleafcommerce.common.extension.ExtensionResultStatusType endBatchEvent(List<? extends Indexable> indexables)
      Perform actions to end a batch event, such as closing any Contexts that have been previously created.
      Returns:
    • addPropertyValues

      org.broadleafcommerce.common.extension.ExtensionResultStatusType addPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String,Object> values, String propertyName, List<org.broadleafcommerce.common.locale.domain.Locale> locales) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
      Given the input field, populates the values array with the fields needed for the passed in field.

      For example, a handler might create multiple fields for the given passed in field.

      Parameters:
      indexable -
      field -
      values -
      propertyName -
      locales -
      Returns:
      Throws:
      IllegalAccessException
      InvocationTargetException
      NoSuchMethodException
    • attachAdditionalBasicFields

      org.broadleafcommerce.common.extension.ExtensionResultStatusType attachAdditionalBasicFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document, SolrHelperService shs)
      Allows the extension additional fields to the document that are not configured via the DB.
    • populateDocumentForIndexField

      org.broadleafcommerce.common.extension.ExtensionResultStatusType populateDocumentForIndexField(org.apache.solr.common.SolrInputDocument document, IndexField field, FieldType fieldType, Map<String,Object> propertyValues)
      This is used to populate any fields for the given parameters as well as adding any property names to the added properties list.
      Parameters:
      document - the document we are populating
      field - the field we are populating the document with
      fieldType - the field type of the field
      propertyValues - the property values for the given Field
      Returns:
      the result of this handler, if NOT_HANDLED, no fields were populated
    • attachAdditionalDocumentFields

      org.broadleafcommerce.common.extension.ExtensionResultStatusType attachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document)
    • attachChildDocuments

      org.broadleafcommerce.common.extension.ExtensionResultStatusType attachChildDocuments(Indexable indexable, org.apache.solr.common.SolrInputDocument document, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
      This extension point allows other modules to contribute child documents to this document.
      Parameters:
      indexable -
      document -
      fields -
      locales -
      Returns:
      either ExtensionResultStatusType.NOT_HANDLED or ExtensionResultStatusType.HANDLED_CONTINUE.