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

Class SolrSearchExpressionProcessor

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


    public class SolrSearchExpressionProcessor
    extends AbstractSearchExpression
    implements com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator

    An implementation of DataMediator to process Solr expression. 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. Injects result grouping parameter option into SolrQuery object by calling SolrSearchResultGroupingQueryPreprocessor;
    8. Generates a list of index field to be included in the search result set by calling SolrSearchResultFieldQueryPreprocessor;
    9. Composes a list of facet field, along with the proper settings, to be included in the search result set by calling SolrSearchFacetQueryPreprocessor;
    10. Injects the main search query string into SolrQuery object by calling SolrSearchMainQueryPreprocessor;
    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, SolrEntityContainerImpl, right after the QueryResponse is returned from the Solr server.
    • Constructor Detail

      • SolrSearchExpressionProcessor

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

      • createEntityObject

        public java.lang.Object createEntityObject(EntityContainer aEntityContainer,
                                                   java.lang.Object anOwningEntityObject,
                                                   java.lang.Class aEntityClass)
        (non-Javadoc)
        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)
        (non-Javadoc)
        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 aEntityContainer)
        (non-Javadoc)
        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()
        (non-Javadoc)
        Specified by:
        getEmptyEntityContainer in interface com.ibm.commerce.foundation.internal.server.services.dataaccess.datamediator.DataMediator
        See Also:
        DataMediator.getEmptyEntityContainer()
      • getControlParameterValue

        public java.lang.String getControlParameterValue(java.lang.String aControlParameterName,
                                                         SelectionCriteria aSelectionCriteria)
        Returns the first value for the given control parameter in the specified SelectionCriteria object.
        Parameters:
        aControlParameterName - Name of the control parameter
        aSelectionCriteria - Selection criteria object
        Returns:
        control parameter value
      • getControlParameterValues

        public java.util.List getControlParameterValues(java.lang.String aControlParameter,
                                                        SelectionCriteria aSelectionCriteria)
        Returns a list of values for the given control parameter in the specified SelectionCriteria object.
        Parameters:
        aControlParameter - Name of the control parameter
        aSelectionCriteria - Selection criteria object
        Returns:
        control parameter value
      • getComponentId

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