Interface SolrIndexUpdateService

All Known Subinterfaces:
CatalogSolrIndexUpdateService
All Known Implementing Classes:
AbstractSolrIndexUpdateServiceImpl, CatalogSolrIndexUpdateServiceImpl

public interface SolrIndexUpdateService
This is the entry point for issuing commands to update Solr indexes / collections.
Author:
Kelly Tisdell
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.solr.common.SolrInputDocument
    Provides an interface for a caller to convert an Indexable into a SolrInputDocument.
    org.apache.solr.common.SolrInputDocument
    buildDocument(Indexable indexable, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
    Provides an interface for a caller to convert an Indexable into a SolrInputDocument.
    void
    Default behavior is to truncate the background collection (offline index), populate it with documents, commit, and then swap (re-alias) so that it becomes the foreground collection and the foreground collection becomes the background.
    void
    updateIndex(List<org.apache.solr.common.SolrInputDocument> documents)
    This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.
    void
    updateIndex(List<org.apache.solr.common.SolrInputDocument> documents, List<String> deleteQueries)
    This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.
  • Method Details

    • rebuildIndex

      void rebuildIndex() throws org.broadleafcommerce.common.exception.ServiceException
      Default behavior is to truncate the background collection (offline index), populate it with documents, commit, and then swap (re-alias) so that it becomes the foreground collection and the foreground collection becomes the background.
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • updateIndex

      void updateIndex(List<org.apache.solr.common.SolrInputDocument> documents) throws org.broadleafcommerce.common.exception.ServiceException
      This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.

      Writes the documents to the foreground collection / index. Then issues a commit.

      This should not be used for incremental indexing in the context of a larger indexing scope or operation.

      Parameters:
      documents -
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • updateIndex

      void updateIndex(List<org.apache.solr.common.SolrInputDocument> documents, List<String> deleteQueries) throws org.broadleafcommerce.common.exception.ServiceException
      This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.

      Executes the delete queries, if any, in the foreground index. Then writes the documents, if any, to the foreground index. Then commits if no errors occur.

      This should not be used for incremental indexing in the context of a larger indexing scope or operation.

      Parameters:
      documents -
      deleteQueries -
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
    • buildDocument

      org.apache.solr.common.SolrInputDocument buildDocument(Indexable indexable)
      Provides an interface for a caller to convert an Indexable into a SolrInputDocument. This may return null if the implementor does not want the specified Indexable indexed.
      Parameters:
      indexable -
      Returns:
    • buildDocument

      org.apache.solr.common.SolrInputDocument buildDocument(Indexable indexable, List<IndexField> fields, List<org.broadleafcommerce.common.locale.domain.Locale> locales)
      Provides an interface for a caller to convert an Indexable into a SolrInputDocument. This may return null if the implementor does not want the specified Indexable indexed.
      Parameters:
      indexable -
      fields -
      locales -
      Returns: