Class ClausesLimitAwareSearchService

java.lang.Object
org.craftercms.studio.impl.v2.service.search.internal.ClausesLimitAwareSearchService
All Implemented Interfaces:
SearchService

public class ClausesLimitAwareSearchService extends Object implements SearchService
A search service that is aware of TooManyNestedClausesSearchException and will retry failing queries with a lower number of max expansions. It will stop retrying once max expansions reaches 1, a different exception is thrown or the query succeeds.
  • Field Details

    • actualSearchService

      protected final SearchService actualSearchService
  • Constructor Details

  • Method Details

    • search

      public SearchResult search(String siteId, SearchParams params, int initialMaxExpansions) throws ServiceLayerException
      Description copied from interface: SearchService
      Performs a search operation for a given site
      Specified by:
      search in interface SearchService
      Parameters:
      siteId - the id of the site
      params - the parameters for the search
      initialMaxExpansions - Specifies the maximum number of terms for fuzzy queries expands to.
      Returns:
      the search results
      Throws:
      ServiceLayerException - if there is any error executing the search in OpenSearch