Class LuceneBackendImpl
- java.lang.Object
-
- org.hibernate.search.backend.lucene.impl.LuceneBackendImpl
-
- All Implemented Interfaces:
LuceneBackend,Backend,BackendImplementor
public class LuceneBackendImpl extends Object implements BackendImplementor, LuceneBackend
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<org.apache.lucene.analysis.Analyzer>analyzer(String name)IndexManagerBuildercreateIndexManagerBuilder(String indexName, String mappedTypeName, BackendBuildContext context, BackendMapperContext backendMapperContext, ConfigurationPropertySource propertySource)Optional<String>name()Optional<org.apache.lucene.analysis.Analyzer>normalizer(String name)CompletableFuture<?>preStop()Prepare forBackendImplementor.stop().voidstart(BackendStartContext context)Start any resource necessary to operate the backend at runtime.voidstop()Stop and release any resource necessary to operate the backend at runtime.BackendtoAPI()StringtoString()<T> Tunwrap(Class<T> clazz)Unwrap the backend to some implementation-specific type.
-
-
-
Method Detail
-
start
public void start(BackendStartContext context)
Description copied from interface:BackendImplementorStart any resource necessary to operate the backend at runtime.Called by the engine once after bootstrap, before
IndexManagerImplementor.start(IndexManagerStartContext)is called on the index managers.- Specified by:
startin interfaceBackendImplementor- Parameters:
context- The start context.
-
preStop
public CompletableFuture<?> preStop()
Description copied from interface:BackendImplementorPrepare forBackendImplementor.stop().- Specified by:
preStopin interfaceBackendImplementor- Returns:
- A future that completes when ongoing works complete.
-
stop
public void stop()
Description copied from interface:BackendImplementorStop and release any resource necessary to operate the backend at runtime.Called by the engine once before shutdown.
- Specified by:
stopin interfaceBackendImplementor
-
unwrap
public <T> T unwrap(Class<T> clazz)
Description copied from interface:BackendUnwrap the backend to some implementation-specific type.
-
name
public Optional<String> name()
- Specified by:
namein interfaceBackend- Returns:
- The name of the backend. In case of a default backend -
an empty optional.
-
toAPI
public Backend toAPI()
- Specified by:
toAPIin interfaceBackendImplementor- Returns:
- The object that should be exposed as API to users.
-
analyzer
public Optional<org.apache.lucene.analysis.Analyzer> analyzer(String name)
- Specified by:
analyzerin interfaceLuceneBackend- Parameters:
name- An analyzer name, e.g. a name returned byIndexValueFieldTypeDescriptor.analyzerName()orIndexValueFieldTypeDescriptor.searchAnalyzerName().- Returns:
- The corresponding analyzer, or
Optional.empty()if it doesn't exist.
-
normalizer
public Optional<org.apache.lucene.analysis.Analyzer> normalizer(String name)
- Specified by:
normalizerin interfaceLuceneBackend- Parameters:
name- A normalizer name, e.g. a name returned byIndexValueFieldTypeDescriptor.normalizerName().- Returns:
- The corresponding normalizer, or
Optional.empty()if it doesn't exist.
-
createIndexManagerBuilder
public IndexManagerBuilder createIndexManagerBuilder(String indexName, String mappedTypeName, BackendBuildContext context, BackendMapperContext backendMapperContext, ConfigurationPropertySource propertySource)
- Specified by:
createIndexManagerBuilderin interfaceBackendImplementor- Parameters:
indexName- The name of the index from the point of view of Hibernate Search. A slightly different name may be used by the backend internally, butindexNameis the one that will appear everywhere the index is mentioned to the user.mappedTypeName- The name of the type mapped to this index. This is the type name that will be assigned to search query hits for this index, allowing the mapper to resolve the type of each hit in multi-index searches. Each index is mapped to one and only one type.context- The build contextpropertySource- A configuration property source, appropriately masked so that the backend doesn't need to care about Hibernate Search prefixes (hibernate.search.*, etc.). All the properties can be accessed at the root. CAUTION: the property keys listed inIndexSettingsare reserved for use by the engine.- Returns:
- A builder for index managers targeting this backend.
-
-