public interface FacetSearchContextFactory<T extends FacetSearchContext>
FacetSearchContext
.
Code creating/destroying contexts should normally use the following pattern:
try
{
final FacetSearchContext facetSearchContext = facetSearchContextFactory.createContext(facetSearchConfig, indexedType, searchQuery);
// call additional setters on the context object
facetSearchContextFactory.initializeContext();
// put your logic here
facetSearchContextFactory.destroyContext();
}
catch (final FacetSearchException | ... | RuntimeException e)
{
facetSearchContextFactory.destroyContext(e);
throw e;
}
| Modifier and Type | Method and Description |
|---|---|
T |
createContext(FacetSearchConfig facetSearchConfig,
IndexedType indexedType,
SearchQuery searchQuery)
Creates a new facet search context and sets it as current one.
|
void |
destroyContext()
Destroys the current context.
|
void |
destroyContext(java.lang.Exception exception)
Destroys the current context because an exception occurred.
|
T |
getContext()
Returns the current context.
|
void |
initializeContext()
Initializes the current context and executes before search query listeners (see
FacetSearchListener.beforeSearch(FacetSearchContext)). |
T createContext(FacetSearchConfig facetSearchConfig, IndexedType indexedType, SearchQuery searchQuery)
facetSearchConfig - - the facet search configurationindexedType - - the indexed typesearchQuery - - the searchvoid initializeContext()
throws FacetSearchException
FacetSearchListener.beforeSearch(FacetSearchContext)).FacetSearchException - if an error occurs during the listeners executionT getContext()
void destroyContext()
throws FacetSearchException
FacetSearchListener.afterSearch(FacetSearchContext)).FacetSearchException - if an error occurs during the listeners executionvoid destroyContext(java.lang.Exception exception)
FacetSearchListener.afterSearchError(FacetSearchContext)).Copyright © 2018 SAP SE. All Rights Reserved.