com.ibm.commerce.search.facade.client

Class SearchFacadeClient



  • public class SearchFacadeClient
    extends AbstractSearchFacadeClient

    This class provides common methods that this and other utility class to the Search facade can use. This class also provides a set of convenient Java API to represent particular Search operations. This set of Java API also include APIs for Web based requests to transform the name value pair request into the appropriate request documents.

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SearchFacadeClient

        public SearchFacadeClient()
        Creates an instance of the client to communicate with the Search facade.
      • SearchFacadeClient

        public SearchFacadeClient(BusinessContextType businessContext,
                                  javax.security.auth.callback.CallbackHandler callbackHandler)
        Creates an instance of the client to communicate with the Search facade.
        Parameters:
        businessContext - The default business context to associate with the messages when making requests.
        callbackHandler - Used for authentication purposes so the controller can give the authentication information to the transport when required.
    • Method Detail

      • getSynonyms

        public java.util.List<java.lang.String> getSynonyms(java.lang.String astrSearchTerm,
                                                            java.lang.String astrLanguageId)
                                                     throws SearchTermAssociationException

        This method returns a list of synonyms for the specified search term based on the specified language and the store path in the context. The comparison to see if synonyms are defined for the specified search term is case-insensitive.

        Parameters:
        astrSearchTerm - The search term. Escape characters for any single quotes are added to the search term in this method.
        astrLanguageId - The language ID where the synonyms are defined, for example "-1" is used for "en_US".
        Returns:
        A list of synonyms for the search term. If there are no synonyms defined, then an empty list is returned.
        Throws:
        SearchTermAssociationException - if an error occurs.
      • getLandingPage

        public java.lang.String getLandingPage(java.lang.String astrSearchTerm,
                                               java.lang.String astrLanguageId,
                                               java.lang.String astrStoreId)
                                        throws SearchTermAssociationException

        This method returns a list of landing pages for the specified search term based on the specified language and the store path in the context.

        Parameters:
        astrSearchTerm - The search term. Escape characters for any single quotes are added to the search term in this method.
        astrLanguageId - The language ID where the synonyms are defined, for example "-1" is used for "en_US".
        astrStoreId - The store ID where the synonyms are defined.
        Returns:
        The first landing page that corresponds to the search term for the current store. If there are no landing pages defined for the current store, the first landing page that corresponds to the search term in the store path is returned. If there are still no matches, then null is returned.
        Throws:
        SearchTermAssociationException - if an error occurs.
      • getSearchTermAssociationsToPublish

        public java.util.Map<java.lang.String,java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>>> getSearchTermAssociationsToPublish(boolean bCaseInsensitive)
                                                                                                                                                            throws SearchTermAssociationException
        This method returns a map of Search Term Associations to be published for the store. The key of the map is the language ID. The value of the map is a map of search term associations. The key of this inner map is a list of search terms. The value of this outer map is a list of associated terms.
        Parameters:
        bCaseInsensitive - Boolean that indicates if the search terms should be converted to lower case.
        Returns:
        Returns a map of search term associations.
        Throws:
        SearchTermAssociationException - if an error occurs.
      • getSynonymsWithReplacement

        public java.util.Set<java.lang.String> getSynonymsWithReplacement(java.lang.String searchTerm,
                                                                          java.lang.String languageIds)
                                                                   throws SearchTermAssociationException
        Get synonyms by search term under specific languages.

        Note that not only the STA synonyms 'Synonym' will be returned, the STA replacement, 'AlsoSearchFor' and 'SearchForInstead', are also handled and merged with STA synonyms as a result set by this method.

        Parameters:
        searchTerm - a search term.
        languageIds - a string of language IDs separated by ','.
        Returns:
        A synonyms set.
        Throws:
        SearchTermAssociationException - exception could be thrown when errors occurred during STA service invocation.
      • getSynonymsWithReplacement

        public java.util.Set<java.lang.String> getSynonymsWithReplacement(java.lang.String searchTerm,
                                                                          java.lang.String languageIds,
                                                                          java.lang.Integer threshold)
                                                                   throws SearchTermAssociationException
        Get synonyms by search term under specific languages.

        Note that not only the STA synonyms 'Synonym' will be returned, the STA replacement, 'AlsoSearchFor' and 'SearchForInstead', are also handled and merged with STA synonyms as a result set by this method.

        Parameters:
        searchTerm - a search term.
        languageIds - a string of language IDs separated by ','.
        threshold - a limit for restricting the maximum number of synonyms to be returned.
        Returns:
        A synonyms set.
        Throws:
        SearchTermAssociationException - exception could be thrown when errors occurred during STA service invocation.