org.broadleafcommerce.core.search.service
Interface SearchService

All Known Implementing Classes:
DatabaseSearchServiceImpl, SolrSearchServiceImpl

public interface SearchService

Author:
Andre Azzolini (apazzolini)

Method Summary
 ProductSearchResult findExplicitProductsByCategory(Category category, ProductSearchCriteria searchCriteria)
          Performs a search for products in the given category, taking into consideration the ProductSearchCriteria This method will NOT return products that are in a sub-level of a given category.
 ProductSearchResult findProductsByCategory(Category category, ProductSearchCriteria searchCriteria)
          Performs a search for products in the given category, taking into consideration the ProductSearchCriteria This method will return products that are in any sub-level of a given category.
 ProductSearchResult findProductsByCategoryAndQuery(Category category, String query, ProductSearchCriteria searchCriteria)
          Performs a search for products in the given category for the given query, taking into consideration the ProductSearchCriteria
 ProductSearchResult findProductsByQuery(String query, ProductSearchCriteria searchCriteria)
          Performs a search for products across all categories for the given query, taking into consideration the ProductSearchCriteria
 List<SearchFacetDTO> getCategoryFacets(Category category)
          Gets all available facets for a given category
 List<SearchFacetDTO> getSearchFacets()
          Gets all available facets for search results page
 void rebuildIndex()
          Rebuilds the current index.
 

Method Detail

findProductsByCategory

ProductSearchResult findProductsByCategory(Category category,
                                           ProductSearchCriteria searchCriteria)
                                           throws ServiceException
Performs a search for products in the given category, taking into consideration the ProductSearchCriteria This method will return products that are in any sub-level of a given category. For example, if you had a "Routers" category and a "Enterprise Routers" sub-category, asking for products in "Routers", would return products that are in the "Enterprise Routers" category.

Parameters:
category -
searchCriteria -
Returns:
the result of the search
Throws:
ServiceException
See Also:
findExplicitProductsByCategory(Category, ProductSearchCriteria)

findExplicitProductsByCategory

ProductSearchResult findExplicitProductsByCategory(Category category,
                                                   ProductSearchCriteria searchCriteria)
                                                   throws ServiceException
Performs a search for products in the given category, taking into consideration the ProductSearchCriteria This method will NOT return products that are in a sub-level of a given category. For example, if you had a "Routers" category and a "Enterprise Routers" sub-category, asking for products in "Routers", would NOT return products that are in the "Enterprise Routers" category.

Parameters:
category -
searchCriteria -
Returns:
Throws:
ServiceException
See Also:
findProductsByCategory(Category, ProductSearchCriteria)

findProductsByQuery

ProductSearchResult findProductsByQuery(String query,
                                        ProductSearchCriteria searchCriteria)
                                        throws ServiceException
Performs a search for products across all categories for the given query, taking into consideration the ProductSearchCriteria

Parameters:
query -
searchCriteria -
Returns:
the result of the search
Throws:
ServiceException

findProductsByCategoryAndQuery

ProductSearchResult findProductsByCategoryAndQuery(Category category,
                                                   String query,
                                                   ProductSearchCriteria searchCriteria)
                                                   throws ServiceException
Performs a search for products in the given category for the given query, taking into consideration the ProductSearchCriteria

Parameters:
category -
query -
searchCriteria -
Throws:
ServiceException

getSearchFacets

List<SearchFacetDTO> getSearchFacets()
Gets all available facets for search results page

Returns:
the available facets

getCategoryFacets

List<SearchFacetDTO> getCategoryFacets(Category category)
Gets all available facets for a given category

Parameters:
category -
Returns:
the available facets

rebuildIndex

void rebuildIndex()
                  throws ServiceException,
                         IOException
Rebuilds the current index. Note that some search service implementations may not necessarily support rebuilding an index (such as the DatabaseProductSearchService)

Throws:
IOException
ServiceException


Copyright © 2013. All Rights Reserved.