Class AbstractSolrIndexServiceExtensionHandler
java.lang.Object
org.broadleafcommerce.common.extension.AbstractExtensionHandler
org.broadleafcommerce.core.search.service.solr.index.AbstractSolrIndexServiceExtensionHandler
- All Implemented Interfaces:
org.broadleafcommerce.common.extension.ExtensionHandler,SolrIndexServiceExtensionHandler
- Direct Known Subclasses:
I18nSolrIndexServiceExtensionHandler
public abstract class AbstractSolrIndexServiceExtensionHandler
extends org.broadleafcommerce.common.extension.AbstractExtensionHandler
implements SolrIndexServiceExtensionHandler
Implementors of the SolrIndexServiceExtensionHandler interface should extend this class so that if
additional extension points are added which they don't care about, their code will not need to be
modified.
- Author:
- bpolster, Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeaddPropertyValues(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.ExtensionResultStatusTypeattachAdditionalBasicFields(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.ExtensionResultStatusTypeattachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document) org.broadleafcommerce.common.extension.ExtensionResultStatusTypeattachChildDocuments(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.ExtensionResultStatusTypeendBatchEvent(List<? extends Indexable> products) Perform actions to end a batch event, such as closing any Contexts that have been previously created.org.broadleafcommerce.common.extension.ExtensionResultStatusTypegetCategoryId(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.ExtensionResultStatusTypegetIndexableId(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.ExtensionResultStatusTypemodifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> products, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales) org.broadleafcommerce.common.extension.ExtensionResultStatusTypepopulateDocumentForIndexField(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.ExtensionResultStatusTypestartBatchEvent(List<? extends Indexable> products) Perform actions at the start of a batch to improve performance of Solr search for the list of batch products.Methods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
getPriority, isEnabled, setEnabled, setPriorityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Constructor Details
-
AbstractSolrIndexServiceExtensionHandler
public AbstractSolrIndexServiceExtensionHandler()
-
-
Method Details
-
addPropertyValues
public 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, NoSuchMethodExceptionDescription copied from interface:SolrIndexServiceExtensionHandlerGiven 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.
- Specified by:
addPropertyValuesin interfaceSolrIndexServiceExtensionHandler- Returns:
- Throws:
IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
attachAdditionalBasicFields
public org.broadleafcommerce.common.extension.ExtensionResultStatusType attachAdditionalBasicFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document, SolrHelperService shs) Description copied from interface:SolrIndexServiceExtensionHandlerAllows the extension additional fields to the document that are not configured via the DB.- Specified by:
attachAdditionalBasicFieldsin interfaceSolrIndexServiceExtensionHandler
-
populateDocumentForIndexField
public org.broadleafcommerce.common.extension.ExtensionResultStatusType populateDocumentForIndexField(org.apache.solr.common.SolrInputDocument document, IndexField field, FieldType fieldType, Map<String, Object> propertyValues) Description copied from interface:SolrIndexServiceExtensionHandlerThis is used to populate any fields for the given parameters as well as adding any property names to the added properties list.- Specified by:
populateDocumentForIndexFieldin interfaceSolrIndexServiceExtensionHandler- Parameters:
document- the document we are populatingfield- the field we are populating the document withfieldType- the field type of the fieldpropertyValues- the property values for the given Field- Returns:
- the result of this handler, if NOT_HANDLED, no fields were populated
-
attachAdditionalDocumentFields
public org.broadleafcommerce.common.extension.ExtensionResultStatusType attachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document) - Specified by:
attachAdditionalDocumentFieldsin interfaceSolrIndexServiceExtensionHandler
-
attachChildDocuments
public 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) Description copied from interface:SolrIndexServiceExtensionHandlerThis extension point allows other modules to contribute child documents to this document.- Specified by:
attachChildDocumentsin interfaceSolrIndexServiceExtensionHandler- Returns:
- either
ExtensionResultStatusType.NOT_HANDLEDorExtensionResultStatusType.HANDLED_CONTINUE.
-
modifyBuiltDocuments
public org.broadleafcommerce.common.extension.ExtensionResultStatusType modifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> products, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales) - Specified by:
modifyBuiltDocumentsin interfaceSolrIndexServiceExtensionHandler
-
startBatchEvent
public org.broadleafcommerce.common.extension.ExtensionResultStatusType startBatchEvent(List<? extends Indexable> products) Description copied from interface:SolrIndexServiceExtensionHandlerPerform 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.- Specified by:
startBatchEventin interfaceSolrIndexServiceExtensionHandler- Returns:
-
endBatchEvent
public org.broadleafcommerce.common.extension.ExtensionResultStatusType endBatchEvent(List<? extends Indexable> products) Description copied from interface:SolrIndexServiceExtensionHandlerPerform actions to end a batch event, such as closing any Contexts that have been previously created.- Specified by:
endBatchEventin interfaceSolrIndexServiceExtensionHandler- Returns:
-
getIndexableId
public org.broadleafcommerce.common.extension.ExtensionResultStatusType getIndexableId(Indexable indexable, Long[] returnContainer) Description copied from interface:SolrIndexServiceExtensionHandlerIn certain scenarios, the requested product id might not be the one that should be used in Solr. If this method returnsExtensionResultStatusType.HANDLED, the value placed in the 0th element in the returnContainer should be used.- Specified by:
getIndexableIdin interfaceSolrIndexServiceExtensionHandler- Returns:
- the extension result status type
-
getCategoryId
public org.broadleafcommerce.common.extension.ExtensionResultStatusType getCategoryId(Long category, Long[] returnContainer) Description copied from interface:SolrIndexServiceExtensionHandlerIn certain scenarios, the requested category id might not be the one that should be used in Solr. If this method returnsExtensionResultStatusType.HANDLED, the value placed in the 0th element in the returnContainer should be used.- Specified by:
getCategoryIdin interfaceSolrIndexServiceExtensionHandler- Returns:
- the extension result status type
-