Class ClausesLimitAwareSearchService
java.lang.Object
org.craftercms.studio.impl.v2.service.search.internal.ClausesLimitAwareSearchService
- All Implemented Interfaces:
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 Summary
FieldsFields inherited from interface org.craftercms.studio.api.v2.service.search.SearchService
DEFAULT_MAX_EXPANSIONS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsearch
(String siteId, SearchParams params, int initialMaxExpansions) Performs a search operation for a given siteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.craftercms.studio.api.v2.service.search.SearchService
search
-
Field Details
-
actualSearchService
-
-
Constructor Details
-
ClausesLimitAwareSearchService
@ConstructorProperties("actualSearchService") public ClausesLimitAwareSearchService(SearchService actualSearchService)
-
-
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 interfaceSearchService
- Parameters:
siteId
- the id of the siteparams
- the parameters for the searchinitialMaxExpansions
- 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
-