Interface SolrIndexServiceExtensionHandler
- All Superinterfaces:
ExtensionHandler
- All Known Implementing Classes:
AbstractSolrIndexServiceExtensionHandler,I18nSolrIndexServiceExtensionHandler
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 TypeMethodDescriptionaddPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String, Object> values, String propertyName, List<Locale> locales) Given the input field, populates the values array with the fields needed for the passed in field.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.attachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document) attachChildDocuments(Indexable indexable, org.apache.solr.common.SolrInputDocument document, List<IndexField> fields, List<Locale> locales) This extension point allows other modules to contribute child documents to this document.endBatchEvent(List<? extends Indexable> indexables) Perform actions to end a batch event, such as closing any Contexts that have been previously created.getCategoryId(Long category, Long[] returnContainer) In certain scenarios, the requested category id might not be the one that should be used in Solr.getIndexableId(Indexable indexable, Long[] returnContainer) In certain scenarios, the requested product id might not be the one that should be used in Solr.modifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> items, List<IndexField> fields, List<Locale> locales) 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.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
In 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.- Parameters:
category-returnContainer-- Returns:
- the extension result status type
-
getIndexableId
In 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.- Parameters:
indexable-returnContainer-- Returns:
- the extension result status type
-
modifyBuiltDocuments
ExtensionResultStatusType modifyBuiltDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents, List<? extends Indexable> items, List<IndexField> fields, List<Locale> locales) -
startBatchEvent
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
Perform actions to end a batch event, such as closing any Contexts that have been previously created.- Returns:
-
addPropertyValues
ExtensionResultStatusType addPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String, Object> values, String propertyName, List<Locale> locales) throws IllegalAccessException, InvocationTargetException, NoSuchMethodExceptionGiven 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:
IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
attachAdditionalBasicFields
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
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 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
ExtensionResultStatusType attachAdditionalDocumentFields(Indexable indexable, org.apache.solr.common.SolrInputDocument document) -
attachChildDocuments
ExtensionResultStatusType attachChildDocuments(Indexable indexable, org.apache.solr.common.SolrInputDocument document, List<IndexField> fields, List<Locale> locales) This extension point allows other modules to contribute child documents to this document.- Parameters:
indexable-document-fields-locales-- Returns:
- either
ExtensionResultStatusType.NOT_HANDLEDorExtensionResultStatusType.HANDLED_CONTINUE.
-