public class IndicesTemplate extends ChildTemplate<co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient> implements IndexOperations
IndexOperations interface using en ElasticsearchIndicesClient.ChildTemplate.ClientCallback<CLIENT,RESULT>| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
boundClass |
protected IndexCoordinates |
boundIndex |
protected ElasticsearchConverter |
elasticsearchConverter |
client, exceptionTranslator, requestConverter, responseConverter| Constructor and Description |
|---|
IndicesTemplate(co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient client,
ElasticsearchConverter elasticsearchConverter,
Class<?> boundClass) |
IndicesTemplate(co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient client,
ElasticsearchConverter elasticsearchConverter,
IndexCoordinates boundIndex) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alias(AliasActions aliasActions)
Executes the given
AliasActions. |
protected Class<?> |
checkForBoundClass() |
boolean |
create()
Create an index.
|
boolean |
create(Map<String,Object> settings)
Create an index for given settings.
|
boolean |
create(Map<String,Object> settings,
Document mapping)
Create an index for given settings and mapping.
|
Document |
createMapping()
Creates the index mapping for the entity this IndexOperations is bound to.
|
Document |
createMapping(Class<?> clazz)
Creates the index mapping for the given class
|
Settings |
createSettings()
Creates the index settings for the entity this IndexOperations is bound to.
|
Settings |
createSettings(Class<?> clazz)
Creates the index settings from the annotations on the given class
|
boolean |
createWithMapping()
Create an index with the settings and mapping defined for the entity this IndexOperations is bound to.
|
boolean |
delete()
Deletes the index this
IndexOperations is bound to |
boolean |
deleteTemplate(DeleteTemplateRequest deleteTemplateRequest)
Deletes an index template using the legacy Elasticsearch interface (@see
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html).
|
protected boolean |
doCreate(IndexCoordinates indexCoordinates,
Map<String,Object> settings,
Document mapping) |
boolean |
exists()
Checks if the index this IndexOperations is bound to exists
|
boolean |
existsTemplate(ExistsTemplateRequest existsTemplateRequest)
check if an index template exists using the legacy Elasticsearch interface.
|
Map<String,Set<AliasData>> |
getAliases(String... aliasNames)
gets information about aliases
|
Map<String,Set<AliasData>> |
getAliasesForIndex(String... indexNames)
gets information about aliases
|
IndexCoordinates |
getIndexCoordinates()
get the current
IndexCoordinates. |
IndexCoordinates |
getIndexCoordinatesFor(Class<?> clazz) |
List<IndexInformation> |
getInformation(IndexCoordinates indexCoordinates)
Gets the
IndexInformation for the indices defined by #index. |
Map<String,Object> |
getMapping()
Get mapping for an index defined by a class.
|
Settings |
getSettings()
Get the index settings.
|
Settings |
getSettings(boolean includeDefaults)
Get the index settings.
|
TemplateData |
getTemplate(GetTemplateRequest getTemplateRequest)
gets an index template using the legacy Elasticsearch interface.
|
boolean |
putMapping(Document mapping)
writes a mapping to the index
|
boolean |
putTemplate(PutTemplateRequest putTemplateRequest)
Creates an index template using the legacy Elasticsearch interface (@see
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html).
|
void |
refresh()
Refresh the index(es) this IndexOperations is bound to
|
executeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeleteTemplate, existsTemplate, getInformation, getTemplate, putMapping, putMappingprotected final ElasticsearchConverter elasticsearchConverter
@Nullable protected final IndexCoordinates boundIndex
public IndicesTemplate(co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient client,
ElasticsearchConverter elasticsearchConverter,
Class<?> boundClass)
public IndicesTemplate(co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient client,
ElasticsearchConverter elasticsearchConverter,
IndexCoordinates boundIndex)
protected Class<?> checkForBoundClass()
public boolean create()
IndexOperationscreate in interface IndexOperationspublic boolean create(Map<String,Object> settings)
IndexOperationscreate in interface IndexOperationssettings - the index settingspublic boolean create(Map<String,Object> settings, Document mapping)
IndexOperationscreate in interface IndexOperationssettings - the index settingsmapping - the index mappingpublic boolean createWithMapping()
IndexOperationscreateWithMapping in interface IndexOperationsprotected boolean doCreate(IndexCoordinates indexCoordinates, Map<String,Object> settings, @Nullable Document mapping)
public boolean delete()
IndexOperationsIndexOperations is bound todelete in interface IndexOperationspublic boolean exists()
IndexOperationsexists in interface IndexOperationspublic void refresh()
IndexOperationsrefresh in interface IndexOperationspublic Document createMapping()
IndexOperationscreateMapping in interface IndexOperationspublic Document createMapping(Class<?> clazz)
IndexOperationscreateMapping in interface IndexOperationsclazz - the clazz to create a mapping forpublic boolean putMapping(Document mapping)
IndexOperationsputMapping in interface IndexOperationsmapping - the Document with the mapping definitionspublic Map<String,Object> getMapping()
IndexOperationsgetMapping in interface IndexOperationspublic Settings createSettings()
IndexOperationscreateSettings in interface IndexOperationspublic Settings createSettings(Class<?> clazz)
IndexOperationscreateSettings in interface IndexOperationsclazz - the class to create the index settings frompublic Settings getSettings()
IndexOperationsgetSettings in interface IndexOperationspublic Settings getSettings(boolean includeDefaults)
IndexOperationsgetSettings in interface IndexOperationsincludeDefaults - whether or not to include all the default settingspublic boolean alias(AliasActions aliasActions)
IndexOperationsAliasActions.alias in interface IndexOperationsaliasActions - the actions to executepublic Map<String,Set<AliasData>> getAliases(String... aliasNames)
IndexOperationsgetAliases in interface IndexOperationsaliasNames - alias names, must not be nullMap from index names to AliasData for that indexpublic Map<String,Set<AliasData>> getAliasesForIndex(String... indexNames)
IndexOperationsgetAliasesForIndex in interface IndexOperationsindexNames - index names, must not be nullMap from index names to AliasData for that indexpublic boolean putTemplate(PutTemplateRequest putTemplateRequest)
IndexOperationsputTemplate in interface IndexOperationsputTemplateRequest - template request parameterspublic TemplateData getTemplate(GetTemplateRequest getTemplateRequest)
IndexOperationsgetTemplate in interface IndexOperationsgetTemplateRequest - the request parameterspublic boolean existsTemplate(ExistsTemplateRequest existsTemplateRequest)
IndexOperationsexistsTemplate in interface IndexOperationsexistsTemplateRequest - the request parameterspublic boolean deleteTemplate(DeleteTemplateRequest deleteTemplateRequest)
IndexOperationsdeleteTemplate in interface IndexOperationsdeleteTemplateRequest - template request parameterspublic List<IndexInformation> getInformation(IndexCoordinates indexCoordinates)
IndexOperationsIndexInformation for the indices defined by #index.getInformation in interface IndexOperationsindexCoordinates - defines the index names to get the information forIndexInformationpublic IndexCoordinates getIndexCoordinates()
IndexOperationsIndexCoordinates. These may change over time when the entity class has a SpEL constructed
index name. When this IndexOperations is not bound to a class, the bound IndexCoordinates are returned.getIndexCoordinates in interface IndexOperationspublic IndexCoordinates getIndexCoordinatesFor(Class<?> clazz)
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.