public interface IndexerQueryContextFactory<T extends IndexerQueryContext>
IndexerQueryContext.
Code creating/destroying contexts should normally use the following pattern:
try
{
final IndexerQueryContext context = indexerQueryContextFactory.createContext(facetSearchConfig, indexedType, query,
queryParameters);
// call additional setters on the context object
indexerQueryContextFactory.initializeContext();
// put your logic here
indexerQueryContextFactory.destroyContext();
}
catch (final IndexerException | ... | RuntimeException exception)
{
indexerQueryContextFactory.destroyContext(exception);
throw exception;
}
| Modifier and Type | Method and Description |
|---|---|
T |
createContext(FacetSearchConfig facetSearchConfig,
IndexedType indexedType,
java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> queryParameters)
Creates a new indexer context and sets it as current.
|
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 the before index listeners (see
IndexerListener.beforeIndex(IndexerContext)). |
T createContext(FacetSearchConfig facetSearchConfig, IndexedType indexedType, java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> queryParameters) throws IndexerException
facetSearchConfig - - the facet search configurationindexedType - - the indexed typequery - - the queryqueryParameters - - the query parametersIndexerException - if an error occurs during the listeners executionvoid initializeContext()
throws IndexerException
IndexerListener.beforeIndex(IndexerContext)).IndexerException - if an error occurs during the listeners executionT getContext()
void destroyContext()
throws IndexerException
IndexerQueryListener.afterQuery(IndexerQueryContext)).IndexerException - if an error occurs during the listeners executionvoid destroyContext(java.lang.Exception exception)
IndexerQueryListener.afterQueryError(IndexerQueryContext)).Copyright © 2018 SAP SE. All Rights Reserved.