public class Requests
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static XContentType |
CONTENT_TYPE
The content type used to generate request builders (query / search).
|
static XContentType |
INDEX_CONTENT_TYPE
The default content type to use to generate source documents when indexing.
|
Constructor and Description |
---|
Requests() |
Modifier and Type | Method and Description |
---|---|
static BulkRequest |
bulkRequest()
Creates a new bulk request.
|
static CancelTasksRequest |
cancelTasksRequest()
Creates a nodes tasks request against one or more nodes.
|
static ClearIndicesCacheRequest |
clearIndicesCacheRequest(java.lang.String... indices)
Creates a clean indices cache request.
|
static CloseIndexRequest |
closeIndexRequest(java.lang.String index)
Creates a close index request.
|
static ClusterHealthRequest |
clusterHealthRequest(java.lang.String... indices)
Creates a cluster health request.
|
static ClusterRerouteRequest |
clusterRerouteRequest() |
static ClusterSearchShardsRequest |
clusterSearchShardsRequest()
List all shards for the give search
|
static ClusterSearchShardsRequest |
clusterSearchShardsRequest(java.lang.String... indices)
List all shards for the give search
|
static ClusterStateRequest |
clusterStateRequest()
Creates a cluster state request.
|
static ClusterStatsRequest |
clusterStatsRequest()
Creates a cluster stats request.
|
static ClusterUpdateSettingsRequest |
clusterUpdateSettingsRequest() |
static CreateIndexRequest |
createIndexRequest(java.lang.String index)
Creates a create index request.
|
static CreateSnapshotRequest |
createSnapshotRequest(java.lang.String repository,
java.lang.String snapshot)
Creates new snapshot
|
static DeleteIndexRequest |
deleteIndexRequest(java.lang.String index)
Creates a delete index request.
|
static DeleteRepositoryRequest |
deleteRepositoryRequest(java.lang.String name)
Deletes registration for snapshot repository
|
static DeleteRequest |
deleteRequest(java.lang.String index)
Creates a delete request against a specific index.
|
static DeleteSnapshotRequest |
deleteSnapshotRequest(java.lang.String repository,
java.lang.String snapshot)
Deletes a snapshot
|
static FlushRequest |
flushRequest(java.lang.String... indices)
Creates a flush indices request.
|
static ForceMergeRequest |
forceMergeRequest(java.lang.String... indices)
Creates a force merge request.
|
static GetRepositoriesRequest |
getRepositoryRequest(java.lang.String... repositories)
Gets snapshot repository
|
static GetRequest |
getRequest(java.lang.String index)
Creates a get request to get the JSON source from an index based on a type and id.
|
static GetSnapshotsRequest |
getSnapshotsRequest(java.lang.String repository)
Gets snapshots from repository
|
static GetTaskRequest |
getTaskRequest()
Creates a get task request.
|
static IndicesAliasesRequest |
indexAliasesRequest()
Creates an index aliases request allowing to add and remove aliases.
|
static IndexRequest |
indexRequest() |
static IndexRequest |
indexRequest(java.lang.String index)
Create an index request against a specific index.
|
static IndicesExistsRequest |
indicesExistsRequest(java.lang.String... indices)
Creates an indices exists request.
|
static IndicesSegmentsRequest |
indicesSegmentsRequest(java.lang.String... indices) |
static IndicesShardStoresRequest |
indicesShardStoresRequest(java.lang.String... indices)
Creates an indices shard stores info request.
|
static ListTasksRequest |
listTasksRequest()
Creates a nodes tasks request against all the nodes.
|
static NodesInfoRequest |
nodesInfoRequest()
Creates a nodes info request against all the nodes.
|
static NodesInfoRequest |
nodesInfoRequest(java.lang.String... nodesIds)
Creates a nodes info request against one or more nodes.
|
static NodesStatsRequest |
nodesStatsRequest(java.lang.String... nodesIds)
Creates a nodes stats request against one or more nodes.
|
static OpenIndexRequest |
openIndexRequest(java.lang.String index)
Creates an open index request.
|
static PutMappingRequest |
putMappingRequest(java.lang.String... indices)
Create a create mapping request against one or more indices.
|
static PutRepositoryRequest |
putRepositoryRequest(java.lang.String name)
Registers snapshot repository
|
static RefreshRequest |
refreshRequest(java.lang.String... indices)
Creates a refresh indices request.
|
static RestoreSnapshotRequest |
restoreSnapshotRequest(java.lang.String repository,
java.lang.String snapshot)
Restores new snapshot
|
static SearchRequest |
searchRequest(java.lang.String... indices)
Creates a search request against one or more indices.
|
static SearchScrollRequest |
searchScrollRequest(java.lang.String scrollId)
Creates a search scroll request allowing to continue searching a previous search request.
|
static SnapshotsStatusRequest |
snapshotsStatusRequest(java.lang.String repository)
Get status of snapshots
|
static SyncedFlushRequest |
syncedFlushRequest(java.lang.String... indices)
Creates a synced flush indices request.
|
static UpdateSettingsRequest |
updateSettingsRequest(java.lang.String... indices)
A request to update indices settings.
|
static UpgradeRequest |
upgradeRequest(java.lang.String... indices)
Creates an upgrade request.
|
static VerifyRepositoryRequest |
verifyRepositoryRequest(java.lang.String name)
Verifies snapshot repository
|
public static XContentType CONTENT_TYPE
public static XContentType INDEX_CONTENT_TYPE
public static IndexRequest indexRequest()
public static IndexRequest indexRequest(java.lang.String index)
IndexRequest.type(String)
must be
set as well and optionally the IndexRequest.id(String)
.index
- The index name to index the request againstClient.index(org.elasticsearch.action.index.IndexRequest)
public static DeleteRequest deleteRequest(java.lang.String index)
DeleteRequest.type(String)
and
DeleteRequest.id(String)
must be set.index
- The index name to delete fromClient.delete(org.elasticsearch.action.delete.DeleteRequest)
public static BulkRequest bulkRequest()
public static GetRequest getRequest(java.lang.String index)
GetRequest.type(String)
and GetRequest.id(String)
must be set.index
- The index to get the JSON source fromClient.get(org.elasticsearch.action.get.GetRequest)
public static SearchRequest searchRequest(java.lang.String... indices)
SearchSourceBuilder
.indices
- The indices to search against. Use null or _all to execute against all indicesClient.search(org.elasticsearch.action.search.SearchRequest)
public static SearchScrollRequest searchScrollRequest(java.lang.String scrollId)
scrollId
- The scroll id representing the scrollable searchClient.searchScroll(org.elasticsearch.action.search.SearchScrollRequest)
public static IndicesSegmentsRequest indicesSegmentsRequest(java.lang.String... indices)
public static IndicesShardStoresRequest indicesShardStoresRequest(java.lang.String... indices)
indices
- The indices to get shard store information onIndicesAdminClient.shardStores(IndicesShardStoresRequest)
public static IndicesExistsRequest indicesExistsRequest(java.lang.String... indices)
indices
- The indices to check if they exists or not.IndicesAdminClient.exists(org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest)
public static CreateIndexRequest createIndexRequest(java.lang.String index)
index
- The index to createIndicesAdminClient.create(org.elasticsearch.action.admin.indices.create.CreateIndexRequest)
public static DeleteIndexRequest deleteIndexRequest(java.lang.String index)
index
- The index to deleteIndicesAdminClient.delete(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)
public static CloseIndexRequest closeIndexRequest(java.lang.String index)
index
- The index to closeIndicesAdminClient.close(org.elasticsearch.action.admin.indices.close.CloseIndexRequest)
public static OpenIndexRequest openIndexRequest(java.lang.String index)
index
- The index to openIndicesAdminClient.open(org.elasticsearch.action.admin.indices.open.OpenIndexRequest)
public static PutMappingRequest putMappingRequest(java.lang.String... indices)
indices
- The indices to create mapping. Use null or _all to execute against all indicesIndicesAdminClient.putMapping(org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest)
public static IndicesAliasesRequest indexAliasesRequest()
public static RefreshRequest refreshRequest(java.lang.String... indices)
indices
- The indices to refresh. Use null or _all to execute against all indicesIndicesAdminClient.refresh(org.elasticsearch.action.admin.indices.refresh.RefreshRequest)
public static FlushRequest flushRequest(java.lang.String... indices)
indices
- The indices to flush. Use null or _all to execute against all indicesIndicesAdminClient.flush(org.elasticsearch.action.admin.indices.flush.FlushRequest)
public static SyncedFlushRequest syncedFlushRequest(java.lang.String... indices)
indices
- The indices to sync flush. Use null or _all to execute against all indicesIndicesAdminClient.syncedFlush(SyncedFlushRequest)
public static ForceMergeRequest forceMergeRequest(java.lang.String... indices)
indices
- The indices to force merge. Use null or _all to execute against all indicesIndicesAdminClient.forceMerge(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest)
public static UpgradeRequest upgradeRequest(java.lang.String... indices)
indices
- The indices to upgrade. Use null or _all to execute against all indicesIndicesAdminClient.upgrade(UpgradeRequest)
public static ClearIndicesCacheRequest clearIndicesCacheRequest(java.lang.String... indices)
indices
- The indices to clean their caches. Use null or _all to execute against all indicespublic static UpdateSettingsRequest updateSettingsRequest(java.lang.String... indices)
indices
- The indices to update the settings for. Use null or _all to executed against all indices.public static ClusterStateRequest clusterStateRequest()
ClusterAdminClient.state(org.elasticsearch.action.admin.cluster.state.ClusterStateRequest)
public static ClusterRerouteRequest clusterRerouteRequest()
public static ClusterUpdateSettingsRequest clusterUpdateSettingsRequest()
public static ClusterHealthRequest clusterHealthRequest(java.lang.String... indices)
indices
- The indices to provide additional cluster health information for.
Use null or _all to execute against all indicesClusterAdminClient.health(org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest)
public static ClusterSearchShardsRequest clusterSearchShardsRequest()
public static ClusterSearchShardsRequest clusterSearchShardsRequest(java.lang.String... indices)
public static NodesInfoRequest nodesInfoRequest()
ClusterAdminClient.nodesInfo(org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest)
public static NodesInfoRequest nodesInfoRequest(java.lang.String... nodesIds)
nodesIds
- The nodes ids to get the status forClusterAdminClient.nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest)
public static NodesStatsRequest nodesStatsRequest(java.lang.String... nodesIds)
nodesIds
- The nodes ids to get the stats forClusterAdminClient.nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest)
public static ClusterStatsRequest clusterStatsRequest()
ClusterAdminClient.clusterStats(org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest)
public static ListTasksRequest listTasksRequest()
ClusterAdminClient.listTasks(ListTasksRequest)
public static GetTaskRequest getTaskRequest()
ClusterAdminClient.getTask(GetTaskRequest)
public static CancelTasksRequest cancelTasksRequest()
ClusterAdminClient.cancelTasks(CancelTasksRequest)
public static PutRepositoryRequest putRepositoryRequest(java.lang.String name)
name
- repository namepublic static GetRepositoriesRequest getRepositoryRequest(java.lang.String... repositories)
repositories
- names of repositoriespublic static DeleteRepositoryRequest deleteRepositoryRequest(java.lang.String name)
name
- repository namepublic static VerifyRepositoryRequest verifyRepositoryRequest(java.lang.String name)
name
- repository namepublic static CreateSnapshotRequest createSnapshotRequest(java.lang.String repository, java.lang.String snapshot)
repository
- repository namesnapshot
- snapshot namepublic static GetSnapshotsRequest getSnapshotsRequest(java.lang.String repository)
repository
- repository namepublic static RestoreSnapshotRequest restoreSnapshotRequest(java.lang.String repository, java.lang.String snapshot)
repository
- repository namesnapshot
- snapshot namepublic static DeleteSnapshotRequest deleteSnapshotRequest(java.lang.String repository, java.lang.String snapshot)
snapshot
- snapshot namerepository
- repository namepublic static SnapshotsStatusRequest snapshotsStatusRequest(java.lang.String repository)
repository
- repository name