public class ElasticsearchAdminServiceImpl extends Object implements ElasticsearchAdminService
ElasticsearchAdminService
Modifier and Type | Field and Description |
---|---|
protected org.springframework.core.io.Resource |
authoringIndexSettings
Index settings file for authoring indices
|
static String |
DEFAULT_INDEX_NAME_SUFFIX |
protected org.elasticsearch.client.RestHighLevelClient |
elasticsearchClient
The Elasticsearch client
|
protected String |
indexNameSuffix
The suffix to add to all index names during creation
|
protected org.springframework.core.io.Resource |
previewIndexSettings
Index settings file for preview indices
|
Constructor and Description |
---|
ElasticsearchAdminServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
createIndex(String indexName,
boolean isAuthoring)
Creates an index
|
void |
deleteIndex(String indexName)
Deletes an index
|
boolean |
exists(String indexName)
Check if an index already exists
|
void |
setAuthoringIndexSettings(org.springframework.core.io.Resource authoringIndexSettings) |
void |
setElasticsearchClient(org.elasticsearch.client.RestHighLevelClient elasticsearchClient) |
void |
setIndexNameSuffix(String indexNameSuffix) |
void |
setPreviewIndexSettings(org.springframework.core.io.Resource previewIndexSettings) |
public static final String DEFAULT_INDEX_NAME_SUFFIX
protected String indexNameSuffix
protected org.springframework.core.io.Resource authoringIndexSettings
protected org.springframework.core.io.Resource previewIndexSettings
protected org.elasticsearch.client.RestHighLevelClient elasticsearchClient
public void setIndexNameSuffix(String indexNameSuffix)
public void setAuthoringIndexSettings(org.springframework.core.io.Resource authoringIndexSettings)
public void setPreviewIndexSettings(org.springframework.core.io.Resource previewIndexSettings)
public void setElasticsearchClient(org.elasticsearch.client.RestHighLevelClient elasticsearchClient)
public boolean exists(String indexName) throws ElasticsearchException
exists
in interface ElasticsearchAdminService
indexName
- the name of the indexElasticsearchException
- if there is any error during the operationpublic void createIndex(String indexName, boolean isAuthoring) throws ElasticsearchException
createIndex
in interface ElasticsearchAdminService
indexName
- the name of the indexisAuthoring
- indicates if the index if for authoringElasticsearchException
- if there is any error during the operationpublic void deleteIndex(String indexName) throws ElasticsearchException
deleteIndex
in interface ElasticsearchAdminService
indexName
- the name of the indexElasticsearchException
- if there is any error during the operationCopyright © 2019 CrafterCMS. All rights reserved.