Interface IndexLayoutStrategy
-
Method Summary
Modifier and TypeMethodDescriptioncreateInitialElasticsearchIndexName
(String hibernateSearchIndexName) Generates an initial non-alias Elasticsearch name for an index.createReadAlias
(String hibernateSearchIndexName) Generates the read alias for an index.createWriteAlias
(String hibernateSearchIndexName) Generates the write alias for an index.default String
extractUniqueKeyFromElasticsearchIndexName
(String elasticsearchIndexName) Extracts a unique key from a (non-alias) Elasticsearch index name.default String
extractUniqueKeyFromHibernateSearchIndexName
(String hibernateSearchIndexName) Extracts a unique key from a Hibernate Search index name.
-
Method Details
-
createInitialElasticsearchIndexName
Generates an initial non-alias Elasticsearch name for an index.When
createReadAlias(String)
orcreateWriteAlias(String)
returnsnull
, this must consistently return the same value for each index, even across multiple executions of the application. Otherwise, the only requirement is that returned names are unique.- Parameters:
hibernateSearchIndexName
- The Hibernate Search name of an index.- Returns:
- The non-alias Elasticsearch name for this index.
-
createWriteAlias
Generates the write alias for an index.This alias will be used when indexing documents, purging the index, ...
This must consistently return the same value for each index, even across multiple executions of the application.
If you do not want to use aliases for write operations, return
null
: the non-alias name returned bycreateInitialElasticsearchIndexName(String)
will be used instead.- Parameters:
hibernateSearchIndexName
- The Hibernate Search name of an index.- Returns:
- The write alias for this index.
-
createReadAlias
Generates the read alias for an index.This alias will be used when executing search queries.
This must consistently return the same value for each index, even across multiple executions of the application.
If you do not want to use aliases for read operations, return
null
: the non-alias name returned bycreateInitialElasticsearchIndexName(String)
will be used instead.- Parameters:
hibernateSearchIndexName
- The Hibernate Search name of an index.- Returns:
- The read alias for this index.
-
extractUniqueKeyFromHibernateSearchIndexName
Extracts a unique key from a Hibernate Search index name.Optional operation: this method only has to be implemented when using the
index-name
type-name mapping strategy.This method will be called once per index on bootstrap.
The returned key must be consistent with the key returned by
extractUniqueKeyFromElasticsearchIndexName(String)
.- Parameters:
hibernateSearchIndexName
- The Hibernate Search name of an index.- Returns:
- The unique key assigned to that index.
-
extractUniqueKeyFromElasticsearchIndexName
Extracts a unique key from a (non-alias) Elasticsearch index name.Optional operation: this method only has to be implemented when using the
index-name
type-name mapping strategy.This method will be called once per index on bootstrap.
The returned key must be consistent with the key returned by
extractUniqueKeyFromHibernateSearchIndexName(String)
.- Parameters:
elasticsearchIndexName
- A primary index name extracted from an Elasticsearch response.- Returns:
- The unique key assigned to that index.
-