org.broadleafcommerce.core.search.service.solr
Interface SolrIndexService

All Known Implementing Classes:
SolrIndexServiceImpl

public interface SolrIndexService

Author:
Andre Azzolini (apazzolini)

Method Summary
 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.
 void buildIncrementalIndex(int page, int pageSize, boolean useReindexServer)
          The internal method for building indexes.
 List<Locale> getAllLocales()
           
 void logDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents)
          Prints out the docs to the trace logger
 void optimizeIndex(org.apache.solr.client.solrj.SolrServer server)
          Triggers the Solr optimize index function on the given server
 void rebuildIndex()
          Rebuilds the current index.
 void restoreState(Object[] pack)
          Restores state that was saved prior to indexing that might have been altered.
 Object[] saveState()
          Saves some global context that might be altered during indexing.
 

Method Detail

rebuildIndex

void rebuildIndex()
                  throws ServiceException,
                         IOException
Rebuilds the current index.

Throws:
IOException
ServiceException

buildIncrementalIndex

void buildIncrementalIndex(int page,
                           int pageSize,
                           boolean useReindexServer)
                           throws ServiceException
The internal method for building indexes. This is exposed via this interface in case someone would like to more granularly control the indexing strategy.

Parameters:
page -
pageSize -
useReindexServer - - if set to false will index directly on the primary server
Throws:
ServiceException
See Also:
restoreState(Object[])

saveState

Object[] saveState()
Saves some global context that might be altered during indexing.

Returns:

restoreState

void restoreState(Object[] pack)
Restores state that was saved prior to indexing that might have been altered.

Parameters:
pack -
See Also:
saveState()

optimizeIndex

void optimizeIndex(org.apache.solr.client.solrj.SolrServer server)
                   throws ServiceException,
                          IOException
Triggers the Solr optimize index function on the given server

Parameters:
server -
Throws:
ServiceException
IOException

logDocuments

void logDocuments(Collection<org.apache.solr.common.SolrInputDocument> documents)
Prints out the docs to the trace logger

Parameters:
documents -

getAllLocales

List<Locale> getAllLocales()
Returns:
a list of all possible locale prefixes to consider

buildDocument

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.

Parameters:
product -
fields -
locales -
Returns:
the document


Copyright © 2013. All Rights Reserved.