com.ibm.commerce.foundation.server.services.rest.search.processor.solr

Class SolrRESTSearchExpressionProcessor

  • All Implemented Interfaces:
    com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator, com.ibm.commerce.foundation.server.services.search.processor.SearchExpressionProcessor


    public class SolrRESTSearchExpressionProcessor
    extends AbstractSearchExpression
    implements com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator, com.ibm.commerce.foundation.server.services.search.processor.SearchExpressionProcessor

    An implementation of DataMediator to process Solr expression for use with RESTful services. This search expression processor will compose the final Solr expression and set up all requirement bootstrap setting for communicating to the Solr search server. The result set will then be mediated into an EntityContainer object to be returned to the caller.

    This expression processor performs the following high level steps in this given order:

    1. Injects a debug parameter option into SolrQuery object by calling SolrSearchDebugQueryPreprocessor;
    2. Includes a relevancy score and additional tracing information into SolrQuery object by calling SolrSearchPreviewQueryPreprocessor;
    3. Enables spell correction and includes its associated parameter options into SolrQuery object by calling SolrSearchSpellCorrectionQueryPreprocessor;
    4. Enables highlighter and includes its associated parameter options into SolrQuery object by calling SolrSearchHighlighterQueryPreprocessor;
    5. Injects pagination parameter options into SolrQuery object by calling SolrSearchPaginationQueryPreprocessor;
    6. Injects sorting parameter option into SolrQuery object by calling SolrSearchSortingQueryPreprocessor;
    7. Generates a list of index field to be included in the search result set by calling SolrSearchResultFieldQueryPreprocessor;
    8. Composes a list of facet field, along with the proper settings, to be included in the search result set by calling SolrSearchFacetQueryPreprocessor;
    9. Injects the main search query string into SolrQuery object by calling SolrSearchMainQueryPreprocessor;
    10. Injects additional custom SolrQuery parameters into the final Solr query expression by calling SolrSearchCustomQueryPreprocessor;
    11. Launches a list of search query pre-processors defined in the given search profile so as to allow modifying the SolrQuery object right before sending to Solr server for processing;
    12. Attempts to connect to Solr server, with retry logics upon connection failures, to process SolrQuery object;
    13. Launches a list of search query post-processors defined in the given search profile so as to allow modifying the physical data object, SearchResponse, right after the QueryResponse is returned from the Solr server.
    • Constructor Detail

      • SolrRESTSearchExpressionProcessor

        public SolrRESTSearchExpressionProcessor(java.lang.String componentId)
        Constructor
        Parameters:
        componentId - a component ID.
    • Method Detail

      • performSearch

        public com.ibm.commerce.foundation.server.services.search.processor.SearchResponse performSearch(SelectionCriteria selectionCriteria)
                                                                                                  throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        Specified by:
        performSearch in interface com.ibm.commerce.foundation.server.services.search.processor.SearchExpressionProcessor
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        See Also:
        SearchExpressionProcessor.performSearch(com.ibm.commerce.foundation.server.services.dataaccess.SelectionCriteria)
      • createEntityObject

        public java.lang.Object createEntityObject(EntityContainer entityContainer,
                                                   java.lang.Object owningEntityObject,
                                                   java.lang.Class entityClass)
        Specified by:
        createEntityObject in interface com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator
        See Also:
        DataMediator.createEntityObject(EntityContainer, Object, Class)
      • removeEntityObject

        public void removeEntityObject(EntityContainer aEntityContainer,
                                       java.lang.Object aEntityObject)
        Specified by:
        removeEntityObject in interface com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator
        See Also:
        DataMediator.removeEntityObject(com.ibm.commerce.foundation.server.services.dataaccess.EntityContainer, java.lang.Object)
      • persistEntityObjects

        public void persistEntityObjects(EntityContainer entityContainer)
        Specified by:
        persistEntityObjects in interface com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator
        See Also:
        DataMediator.persistEntityObjects(com.ibm.commerce.foundation.server.services.dataaccess.EntityContainer)
      • getEmptyEntityContainer

        public EntityContainer getEmptyEntityContainer()
        Specified by:
        getEmptyEntityContainer in interface com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator
        See Also:
        DataMediator.getEmptyEntityContainer()
      • getComponentId

        public java.lang.String getComponentId()
        Returns the component identifier.
        Returns:
        component identifier.