|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.search.service.solr.SolrIndexServiceImpl
@Service(value="blSolrIndexService") public class SolrIndexServiceImpl
Responsible for building and rebuilding the Solr index
| Field Summary | |
|---|---|
protected SolrSearchServiceExtensionListener |
extensionManager
|
protected FieldDao |
fieldDao
|
protected LocaleService |
localeService
|
protected int |
pageSize
|
protected ProductDao |
productDao
|
protected SolrHelperService |
shs
|
protected org.springframework.transaction.PlatformTransactionManager |
transactionManager
|
| Constructor Summary | |
|---|---|
SolrIndexServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
attachBasicDocumentFields(Product product,
org.apache.solr.common.SolrInputDocument document)
Adds the ID, category, and explicitCategory fields for the product to the document |
protected org.apache.solr.common.SolrInputDocument |
buildDocument(Product product,
List<Field> fields,
List<Locale> locales)
Given a product, fields that relate to that product, and a list of locales and pricelists, builds a SolrInputDocument to be added to the Solr index. |
protected void |
buildIncrementalIndex(int page,
int pageSize)
|
protected String |
convertToMappedProperty(String propertyName,
String listPropertyName,
String mapPropertyName)
Converts a propertyName to one that is able to reference inside a map. |
protected void |
deleteAllDocuments()
|
protected void |
finalizeTransaction(org.springframework.transaction.TransactionStatus status,
boolean isError)
|
protected List<Locale> |
getAllLocales()
|
protected Map<String,Object> |
getPropertyValues(Product product,
Field field,
FieldType fieldType,
List<Locale> locales)
Returns a map of prefix to value for the requested attributes. |
protected List<Product> |
readAllActiveProducts()
This method to read all active products will be slow if you have a large catalog. |
protected List<Product> |
readAllActiveProducts(int page,
int pageSize)
This method to read active products utilizes paging to improve performance over readAllActiveProducts(). |
void |
rebuildIndex()
Rebuilds the current index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Value(value="${solr.index.product.pageSize}")
protected int pageSize
protected ProductDao productDao
protected FieldDao fieldDao
protected LocaleService localeService
protected SolrHelperService shs
protected SolrSearchServiceExtensionListener extensionManager
protected org.springframework.transaction.PlatformTransactionManager transactionManager
| Constructor Detail |
|---|
public SolrIndexServiceImpl()
| Method Detail |
|---|
public void rebuildIndex()
throws ServiceException,
IOException
SolrIndexService
rebuildIndex in interface SolrIndexServiceServiceException
IOException
protected void deleteAllDocuments()
throws ServiceException
ServiceException
protected void buildIncrementalIndex(int page,
int pageSize)
throws ServiceException
ServiceException
protected void finalizeTransaction(org.springframework.transaction.TransactionStatus status,
boolean isError)
protected List<Product> readAllActiveProducts()
protected List<Product> readAllActiveProducts(int page,
int pageSize)
readAllActiveProducts().
While not optimal, this will reduce the memory required to load large catalogs.
It could still be improved for specific implementations by only loading fields that will be indexed or by accessing
the database via direct JDBC (instead of Hibernate).
protected List<Locale> getAllLocales()
protected org.apache.solr.common.SolrInputDocument buildDocument(Product product,
List<Field> fields,
List<Locale> locales)
product - fields - locales -
protected void attachBasicDocumentFields(Product product,
org.apache.solr.common.SolrInputDocument document)
product - document -
protected Map<String,Object> getPropertyValues(Product product,
Field field,
FieldType fieldType,
List<Locale> locales)
throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
product - field - isPriceField - prefix -
IllegalAccessException
InvocationTargetException
NoSuchMethodException
protected String convertToMappedProperty(String propertyName,
String listPropertyName,
String mapPropertyName)
propertyName - listPropertyName - mapPropertyName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||