Package org.hibernate.search
Interface MassIndexer
-
@Deprecated public interface MassIndexer
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create a mass indexer withSearchSession.massIndexer(Class[]). Refer to the migration guide for more information.A MassIndexer is useful to rebuild the indexes from the data contained in the database. This process is expensive: all indexed entities and their indexedEmbedded properties are scrolled from database.- Author:
- Sanne Grinovero
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description MassIndexerbatchSizeToLoadObjects(int batchSize)Deprecated.Sets the batch size used to load the root entities.MassIndexercacheMode(org.hibernate.CacheMode cacheMode)Deprecated.Sets the cache interaction mode for the data loading tasks.MassIndexeridFetchSize(int idFetchSize)Deprecated.Specifies the fetch size to be used when loading primary keys if objects to be indexed.MassIndexerlimitIndexedObjectsTo(long maximum)Deprecated.EXPERIMENTAL method: will probably change Will stop indexing after having indexed a set amount of objects.MassIndexeroptimizeAfterPurge(boolean optimize)Deprecated.If index optimization should be run before starting, after the purgeAll.MassIndexeroptimizeOnFinish(boolean optimize)Deprecated.If index optimization has to be started at the end of the indexing process.MassIndexerprogressMonitor(MassIndexerProgressMonitor monitor)Deprecated.Override the defaultMassIndexerProgressMonitor.MassIndexerpurgeAllOnStart(boolean purgeAll)Deprecated.If all entities should be removed from the index before starting using purgeAll.Future<?>start()Deprecated.Starts the indexing process in background (asynchronous).voidstartAndWait()Deprecated.Starts the indexing process, and then block until it's finished.MassIndexerthreadsForSubsequentFetching(int numberOfThreads)Deprecated.Being ignored: this method will be removed.MassIndexerthreadsToLoadObjects(int numberOfThreads)Deprecated.Set the number of threads to be used to load the root entities.MassIndexertransactionTimeout(int timeoutInSeconds)Deprecated.Timeout of transactions for loading ids and entities to be re-indexed.MassIndexertypesToIndexInParallel(int threadsToIndexObjects)Deprecated.Sets the number of entity types to be indexed in parallel.
-
-
-
Method Detail
-
typesToIndexInParallel
MassIndexer typesToIndexInParallel(int threadsToIndexObjects)
Deprecated.Sets the number of entity types to be indexed in parallel. Defaults to 1.- Parameters:
threadsToIndexObjects- number of entity types to be indexed in parallel- Returns:
thisfor method chaining
-
threadsToLoadObjects
MassIndexer threadsToLoadObjects(int numberOfThreads)
Deprecated.Set the number of threads to be used to load the root entities.- Parameters:
numberOfThreads- the number of threads- Returns:
thisfor method chaining
-
batchSizeToLoadObjects
MassIndexer batchSizeToLoadObjects(int batchSize)
Deprecated.Sets the batch size used to load the root entities.- Parameters:
batchSize- the batch size- Returns:
thisfor method chaining
-
threadsForSubsequentFetching
@Deprecated MassIndexer threadsForSubsequentFetching(int numberOfThreads)
Deprecated.Being ignored: this method will be removed.Deprecated: value is ignored.- Parameters:
numberOfThreads- the number of threads- Returns:
thisfor method chaining
-
progressMonitor
MassIndexer progressMonitor(MassIndexerProgressMonitor monitor)
Deprecated.Override the defaultMassIndexerProgressMonitor.- Parameters:
monitor- this instance will receive updates about the massindexing progress.- Returns:
thisfor method chaining
-
cacheMode
MassIndexer cacheMode(org.hibernate.CacheMode cacheMode)
Deprecated.Sets the cache interaction mode for the data loading tasks. Defaults toCacheMode.IGNORE.- Parameters:
cacheMode- the cache interaction mode- Returns:
thisfor method chaining
-
optimizeOnFinish
MassIndexer optimizeOnFinish(boolean optimize)
Deprecated.If index optimization has to be started at the end of the indexing process. Defaults totrue.- Parameters:
optimize-trueto enable the index optimization at the end of the indexing process- Returns:
thisfor method chaining
-
optimizeAfterPurge
MassIndexer optimizeAfterPurge(boolean optimize)
Deprecated.If index optimization should be run before starting, after the purgeAll. Has no effect ifpurgeAllis set to false. Defaults totrue.- Parameters:
optimize-trueto enable the index optimization after purge- Returns:
thisfor method chaining
-
purgeAllOnStart
MassIndexer purgeAllOnStart(boolean purgeAll)
Deprecated.If all entities should be removed from the index before starting using purgeAll. Set it to false only if you know there are no entities in the index: otherwise search results may be duplicated. Defaults to true.- Parameters:
purgeAll- iftrueall entities will be removed from the index before starting the indexing- Returns:
thisfor method chaining
-
limitIndexedObjectsTo
MassIndexer limitIndexedObjectsTo(long maximum)
Deprecated.EXPERIMENTAL method: will probably change Will stop indexing after having indexed a set amount of objects. As a results the index will not be consistent with the database: use only for testing on an (undefined) subset of database data.- Parameters:
maximum- the maximum number of objects to index- Returns:
thisfor method chaining
-
start
Future<?> start()
Deprecated.Starts the indexing process in background (asynchronous). Can be called only once.- Returns:
- a Future to control the indexing task.
-
startAndWait
void startAndWait() throws InterruptedExceptionDeprecated.Starts the indexing process, and then block until it's finished. Can be called only once.- Throws:
InterruptedException- if the current thread is interrupted while waiting.
-
idFetchSize
MassIndexer idFetchSize(int idFetchSize)
Deprecated.Specifies the fetch size to be used when loading primary keys if objects to be indexed. Some databases accept special values, for example MySQL might benefit from usingInteger.MIN_VALUEotherwise it will attempt to preload everything in memory.- Parameters:
idFetchSize- the fetch size to be used when loading primary keys- Returns:
thisfor method chaining
-
transactionTimeout
MassIndexer transactionTimeout(int timeoutInSeconds)
Deprecated.Timeout of transactions for loading ids and entities to be re-indexed. Specify a timeout which is long enough to load and index all entities of the type with the most instances, taking into account the configured batch size and number of threads to load objects.Only supported in JTA-compatible environments.
- Parameters:
timeoutInSeconds- the transaction timeout in seconds; If no value is given, the global default timeout of the JTA environment applies.- Returns:
thisfor method chaining
-
-