Class LuceneIndexSettings
Constants in this class are to be appended to a prefix to form a property key;
see IndexSettings
for details.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Default values for the different settings if no values are given.static final class
Configuration property keys for directories without theprefix
.static final class
Configuration property keys for indexing, without theprefix
.static final class
Configuration property keys for I/O, without theprefix
.static final class
Configuration property keys for merge options, without theprefix
.static final class
Configuration property keys for sharding, without theprefix
.static final class
Configuration property keys for index writer options, without theprefix
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
How to access the filesystem in the directory.static final String
How to lock on the directory.static final String
The prefix for directory-related property keys.static final String
The filesystem root for the directory.static final String
The type of directory to use when reading from or writing to the index.static final String
The prefix for indexing-related property keys.static final String
The number of indexing queues assigned to each index (or each shard of each index, when sharding is enabled).static final String
The size of indexing queues.static final String
How much time may pass after an index change until the change is committed.static final String
The value to pass toLogMergePolicy.setCalibrateSizeByDeletes(boolean)
.static final String
The value to pass toLogMergePolicy.setMergeFactor(int)
.static final String
The value to pass toLogMergePolicy.setMaxMergeDocs(int)
.static final String
The value to pass toLogByteSizeMergePolicy.setMaxMergeMBForForcedMerge(double)
.static final String
The value to pass toLogByteSizeMergePolicy.setMaxMergeMB(double)
.static final String
The value to pass toLogByteSizeMergePolicy.setMinMergeMB(double)
.static final String
The prefix for property keys related to merge.static final String
The prefix for I/O-related property keys.static final String
How much time may pass after an index write until the index reader is considered stale and re-created.static final String
How to handle input/output, i.e.static final String
Whether to log theIndexWriterConfig.setInfoStream(InfoStream)
(at the trace level) or not.static final String
The value to pass toIndexWriterConfig.setMaxBufferedDocs(int)
.static final String
The prefix for property keys related to the index writer.static final String
The value to pass toIndexWriterConfig.setRAMBufferSizeMB(double)
.static final String
The number of shards to create for the index, i.e.static final String
The prefix for sharding-related property keys.static final String
The list of shard identifiers to accept for the index.static final String
The sharding strategy, deciding the number of shards, their identifiers, and how to translate a routing key into a shard identifier.static final String
The root property whose children are shards, e.g. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Builds a configuration property key for the given shard of all indexes of the default backend, with the given radical.static String
Builds a configuration property key for the given shard of the given index of the default backend, with the given radical.static String
Builds a configuration property key for the given shard of the given index of the given backend, with the given radical.
-
Field Details
-
DIRECTORY_PREFIX
The prefix for directory-related property keys.- See Also:
-
DIRECTORY_TYPE
The type of directory to use when reading from or writing to the index.Expects a String, such as "local-filesystem". See the reference documentation for a list of available values.
Defaults to
LuceneIndexSettings.Defaults.DIRECTORY_TYPE
.- See Also:
-
DIRECTORY_ROOT
The filesystem root for the directory.Only available for the "local-filesystem" directory type.
Expects a String representing a path to an existing directory accessible in read and write mode, such as "local-filesystem".
The actual index files will be created in directory
<root>/<index-name>
.Defaults to the JVM's working directory.
- See Also:
-
DIRECTORY_LOCKING_STRATEGY
How to lock on the directory.Expects a
LockingStrategyName
value, or a String representation of such value.Defaults are specific to each directory type.
- See Also:
-
DIRECTORY_FILESYSTEM_ACCESS_STRATEGY
How to access the filesystem in the directory.Only available for the "local-filesystem" directory type.
Expects a
FileSystemAccessStrategyName
value, or a String representation of such value.Defaults to
LuceneIndexSettings.Defaults.DIRECTORY_FILESYSTEM_ACCESS_STRATEGY
.- See Also:
-
IO_PREFIX
The prefix for I/O-related property keys.- See Also:
-
IO_STRATEGY
How to handle input/output, i.e. how to write to and read from indexes.Expects a
IOStrategyName
value, or a String representation of such value.Defaults to
LuceneIndexSettings.Defaults.IO_STRATEGY
.- See Also:
-
IO_COMMIT_INTERVAL
How much time may pass after an index change until the change is committed.Only available for the "near-real-time" I/O strategy.
This effectively defines how long changes may be in an "unsafe" state, where a crash or power loss will result in data loss. For example:
- if set to 0, changes are safe as soon as the background process finishes treating a batch of changes.
- if set to 1000, changes may not be safe for an additional 1 second after the background process finishes treating a batch. There is a benefit, though: index changes occurring less than 1 second after another change may execute faster.
Note that individual write operations may trigger a forced commit (for example with the
write-sync
andsync
indexing plan synchronization strategies in the ORM mapper), in which case you will only benefit from a non-zero commit interval during intensive indexing (mass indexer, ...).Note that committing is not necessary to make changes visible to search queries: the two concepts are unrelated. See
IO_REFRESH_INTERVAL
.Expects a positive Integer value in milliseconds, such as
1000
, or a String that can be parsed into such Integer value.Defaults to
LuceneIndexSettings.Defaults.IO_COMMIT_INTERVAL
.- See Also:
-
IO_REFRESH_INTERVAL
How much time may pass after an index write until the index reader is considered stale and re-created.Only available for the "near-real-time" I/O strategy.
This effectively defines how out-of-date search query results may be. For example:
- If set to 0, search results will always be completely in sync with the index writes.
- If set to 1000, search results may reflect the state of the index at most 1 second ago. There is a benefit, though: in situations where the index is being frequently written to, search queries executed less than 1 second after another query may execute faster.
Note that individual write operations may trigger a forced refresh (for example with the
read-sync
andsync
indexing plan synchronization strategies in the ORM mapper), in which case you will only benefit from a non-zero refresh interval during intensive indexing (mass indexer, ...).Expects a positive Integer value in milliseconds, such as
1000
, or a String that can be parsed into such Integer value.Defaults to
LuceneIndexSettings.Defaults.IO_REFRESH_INTERVAL
.- See Also:
-
IO_WRITER_PREFIX
The prefix for property keys related to the index writer.- See Also:
-
IO_WRITER_MAX_BUFFERED_DOCS
The value to pass toIndexWriterConfig.setMaxBufferedDocs(int)
.Expects a positive Integer value, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_WRITER_RAM_BUFFER_SIZE
The value to pass toIndexWriterConfig.setRAMBufferSizeMB(double)
.Expects a positive Integer value in megabytes, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_WRITER_INFOSTREAM
Whether to log theIndexWriterConfig.setInfoStream(InfoStream)
(at the trace level) or not.Logs are appended to the logger "org.hibernate.search.backend.lucene.infostream".
Expects a Boolean value such as
true
orfalse
, or a String that can be parsed into such Boolean value.Default is
false
. -
IO_MERGE_PREFIX
The prefix for property keys related to merge.- See Also:
-
IO_MERGE_MAX_DOCS
The value to pass toLogMergePolicy.setMaxMergeDocs(int)
.Expects a positive Integer value, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_MERGE_FACTOR
The value to pass toLogMergePolicy.setMergeFactor(int)
.Expects a positive Integer value, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_MERGE_MIN_SIZE
The value to pass toLogByteSizeMergePolicy.setMinMergeMB(double)
.Expects a positive Integer value in megabytes, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_MERGE_MAX_SIZE
The value to pass toLogByteSizeMergePolicy.setMaxMergeMB(double)
.Expects a positive Integer value in megabytes, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_MERGE_MAX_FORCED_SIZE
The value to pass toLogByteSizeMergePolicy.setMaxMergeMBForForcedMerge(double)
.Expects a positive Integer value in megabytes, or a String that can be parsed into such Integer value.
The default for this setting is defined by Lucene.
-
IO_MERGE_CALIBRATE_BY_DELETES
The value to pass toLogMergePolicy.setCalibrateSizeByDeletes(boolean)
.Expects a Boolean value such as
true
orfalse
, or a String that can be parsed into such Boolean value.The default for this setting is defined by Lucene.
-
SHARDING_PREFIX
The prefix for sharding-related property keys.- See Also:
-
SHARDING_STRATEGY
The sharding strategy, deciding the number of shards, their identifiers, and how to translate a routing key into a shard identifier.Expects a String, such as "hash". See the reference documentation for a list of available values.
Defaults to
LuceneIndexSettings.Defaults.SHARDING_STRATEGY
(no sharding).- See Also:
-
SHARDING_NUMBER_OF_SHARDS
The number of shards to create for the index, i.e. the number of "physical" indexes, each holding a part of the index data.Only available for the
hash
sharding strategy
.Expects a strictly positive Integer value, such as 4, or a String that can be parsed into such Integer value.
No default: this property must be set when using the
hash
sharding strategy.- See Also:
-
SHARDING_SHARD_IDENTIFIERS
The list of shard identifiers to accept for the index.Only available for the
explicit
sharding strategy
.Expects either a String containing multiple shard identifiers separated by commas (','), or a
Collection<String>
containing such shard identifiers.No default: this property must be set when using the
explicit
sharding strategy.- See Also:
-
SHARDS
The root property whose children are shards, e.g.shards.0.<some shard-scoped property> = bar
orshards.1.<some shard-scoped property> = bar
orshards.main.<some shard-scoped property> = bar
.- See Also:
-
INDEXING_PREFIX
The prefix for indexing-related property keys.- See Also:
-
INDEXING_QUEUE_COUNT
The number of indexing queues assigned to each index (or each shard of each index, when sharding is enabled).Expects a strictly positive integer value, or a string that can be parsed into an integer value.
See the reference documentation, section "Lucene backend - Indexing", for more information about this setting and its implications.
Defaults to
LuceneIndexSettings.Defaults.INDEXING_QUEUE_COUNT
.- See Also:
-
INDEXING_QUEUE_SIZE
The size of indexing queues.Expects a strictly positive integer value, or a string that can be parsed into an integer value.
See the reference documentation, section "Lucene backend - Indexing", for more information about this setting and its implications.
Defaults to
LuceneIndexSettings.Defaults.INDEXING_QUEUE_SIZE
.- See Also:
-
-
Method Details
-
shardKey
Builds a configuration property key for the given shard of all indexes of the default backend, with the given radical.See constants in this class for available radicals.
Example result: "hibernate.search.backend.shard.<shardId>.indexing.queue_count
"- Parameters:
shardId
- The identifier of the shard to configure.radical
- The radical of the configuration property (see constants in this class).- Returns:
- the concatenated shard settings key
-
shardKey
Builds a configuration property key for the given shard of the given index of the default backend, with the given radical.See constants in this class for available radicals.
Example result: "hibernate.search.backends.<backendName>.indexes.<indexName>.shard.<shardId>.indexing.queue_count
"- Parameters:
indexName
- The name of the index in which the shard to configure is located.shardId
- The identifier of the shard to configure.radical
- The radical of the configuration property (see constants in this class).- Returns:
- the concatenated shard settings key
-
shardKey
Builds a configuration property key for the given shard of the given index of the given backend, with the given radical.See constants in this class for available radicals.
Example result: "hibernate.search.backends.<backendName>.indexes.<indexName>.shard.<shardId>.indexing.queue_count
"- Parameters:
backendName
- The name of the backend in which the shard to configure is located.indexName
- The name of the index in which the shard to configure is located.shardId
- The identifier of the shard to configure.radical
- The radical of the configuration property (see constants in this class).- Returns:
- the concatenated shard settings key
-