public abstract class AbstractIndexTemplate extends Object implements IndexOperations
IndexOperations common to Transport and Rest based Implementations of IndexOperations.| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
boundClass |
protected ElasticsearchConverter |
elasticsearchConverter |
| Constructor and Description |
|---|
AbstractIndexTemplate(ElasticsearchConverter elasticsearchConverter,
Class<?> boundClass) |
AbstractIndexTemplate(ElasticsearchConverter elasticsearchConverter,
IndexCoordinates boundIndex) |
| Modifier and Type | Method and Description |
|---|---|
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 |
protected abstract boolean |
doCreate(IndexCoordinates index,
Map<String,Object> settings,
Document mapping) |
protected abstract boolean |
doDelete(IndexCoordinates index) |
protected abstract boolean |
doExists(IndexCoordinates index) |
protected abstract Map<String,Set<AliasData>> |
doGetAliases(String[] aliasNames,
String[] indexNames) |
protected abstract Map<String,Object> |
doGetMapping(IndexCoordinates index) |
protected abstract Settings |
doGetSettings(IndexCoordinates index,
boolean includeDefaults) |
protected abstract boolean |
doPutMapping(IndexCoordinates index,
Document mapping) |
protected abstract void |
doRefresh(IndexCoordinates indexCoordinates) |
boolean |
exists()
Checks if the index this IndexOperations is bound to exists
|
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) |
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.
|
boolean |
putMapping(Document mapping)
writes a mapping to the index
|
void |
refresh()
Refresh the index(es) this IndexOperations is bound to
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalias, deleteTemplate, deleteTemplate, existsTemplate, existsTemplate, getInformation, getInformation, getTemplate, getTemplate, putMapping, putMapping, putTemplateprotected final ElasticsearchConverter elasticsearchConverter
public AbstractIndexTemplate(ElasticsearchConverter elasticsearchConverter, Class<?> boundClass)
public AbstractIndexTemplate(ElasticsearchConverter elasticsearchConverter, IndexCoordinates boundIndex)
protected Class<?> checkForBoundClass()
public boolean create()
IndexOperationscreate in interface IndexOperationspublic Settings createSettings(Class<?> clazz)
IndexOperationscreateSettings in interface IndexOperationsclazz - the class to create the index settings frompublic boolean createWithMapping()
IndexOperationscreateWithMapping 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 mappingprotected abstract boolean doCreate(IndexCoordinates index, Map<String,Object> settings, @Nullable Document mapping)
public boolean delete()
IndexOperationsIndexOperations is bound todelete in interface IndexOperationsprotected abstract boolean doDelete(IndexCoordinates index)
public boolean exists()
IndexOperationsexists in interface IndexOperationsprotected abstract boolean doExists(IndexCoordinates index)
public boolean putMapping(Document mapping)
IndexOperationsputMapping in interface IndexOperationsmapping - the Document with the mapping definitionsprotected abstract boolean doPutMapping(IndexCoordinates index, Document mapping)
public Map<String,Object> getMapping()
IndexOperationsgetMapping in interface IndexOperationsprotected abstract Map<String,Object> doGetMapping(IndexCoordinates index)
public Settings getSettings()
IndexOperationsgetSettings in interface IndexOperationspublic Settings getSettings(boolean includeDefaults)
IndexOperationsgetSettings in interface IndexOperationsincludeDefaults - whether or not to include all the default settingsprotected abstract Settings doGetSettings(IndexCoordinates index, boolean includeDefaults)
public void refresh()
IndexOperationsrefresh in interface IndexOperationsprotected abstract void doRefresh(IndexCoordinates indexCoordinates)
public 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 indexprotected abstract Map<String,Set<AliasData>> doGetAliases(@Nullable String[] aliasNames, @Nullable String[] indexNames)
public Document createMapping()
IndexOperationscreateMapping in interface IndexOperationspublic Document createMapping(Class<?> clazz)
IndexOperationscreateMapping in interface IndexOperationsclazz - the clazz to create a mapping forpublic Settings createSettings()
IndexOperationscreateSettings in interface IndexOperationspublic 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.