public class Requests extends 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()
Creats a new bulk request.
|
static CancelTasksRequest |
cancelTasksRequest()
Creates a nodes tasks request against one or more nodes.
|
static ClearIndicesCacheRequest |
clearIndicesCacheRequest(String... indices)
Creates a clean indices cache request.
|
static CloseIndexRequest |
closeIndexRequest(String index)
Creates a close index request.
|
static ClusterHealthRequest |
clusterHealthRequest(String... indices)
Creates a cluster health request.
|
static ClusterRerouteRequest |
clusterRerouteRequest() |
static ClusterSearchShardsRequest |
clusterSearchShardsRequest()
List all shards for the give search
|
static ClusterSearchShardsRequest |
clusterSearchShardsRequest(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 CountRequest |
countRequest(String... indices)
Deprecated.
use
searchRequest(String...) instead and set size to 0 |
static CreateIndexRequest |
createIndexRequest(String index)
Creates a create index request.
|
static CreateSnapshotRequest |
createSnapshotRequest(String repository,
String snapshot)
Creates new snapshot
|
static DeleteIndexRequest |
deleteIndexRequest(String index)
Creates a delete index request.
|
static DeleteRepositoryRequest |
deleteRepositoryRequest(String name)
Deletes registration for snapshot repository
|
static DeleteRequest |
deleteRequest(String index)
Creates a delete request against a specific index.
|
static DeleteSnapshotRequest |
deleteSnapshotRequest(String repository,
String snapshot)
Deletes a snapshot
|
static ExistsRequest |
existsRequest(String... indices)
Deprecated.
use
SearchRequest instead and set `size` to `0` and `terminate_after` to `1` |
static FlushRequest |
flushRequest(String... indices)
Creates a flush indices request.
|
static ForceMergeRequest |
forceMergeRequest(String... indices)
Creates a force merge request.
|
static GetRepositoriesRequest |
getRepositoryRequest(String... repositories)
Gets snapshot repository
|
static GetRequest |
getRequest(String index)
Creates a get request to get the JSON source from an index based on a type and id.
|
static GetSnapshotsRequest |
getSnapshotsRequest(String repository)
Gets snapshots from repository
|
static IndicesAliasesRequest |
indexAliasesRequest()
Creates an index aliases request allowing to add and remove aliases.
|
static IndexRequest |
indexRequest() |
static IndexRequest |
indexRequest(String index)
Create an index request against a specific index.
|
static IndicesExistsRequest |
indicesExistsRequest(String... indices)
Creates an indices exists request.
|
static IndicesSegmentsRequest |
indicesSegmentsRequest(String... indices) |
static IndicesShardStoresRequest |
indicesShardStoresRequest(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(String... nodesIds)
Creates a nodes info request against one or more nodes.
|
static NodesStatsRequest |
nodesStatsRequest(String... nodesIds)
Creates a nodes stats request against one or more nodes.
|
static OpenIndexRequest |
openIndexRequest(String index)
Creates an open index request.
|
static PutMappingRequest |
putMappingRequest(String... indices)
Create a create mapping request against one or more indices.
|
static PutRepositoryRequest |
putRepositoryRequest(String name)
Registers snapshot repository
|
static RefreshRequest |
refreshRequest(String... indices)
Creates a refresh indices request.
|
static RestoreSnapshotRequest |
restoreSnapshotRequest(String repository,
String snapshot)
Restores new snapshot
|
static SearchRequest |
searchRequest(String... indices)
Creates a search request against one or more indices.
|
static SearchScrollRequest |
searchScrollRequest(String scrollId)
Creates a search scroll request allowing to continue searching a previous search request.
|
static SnapshotsStatusRequest |
snapshotsStatusRequest(String repository)
Get status of snapshots
|
static SuggestRequest |
suggestRequest(String... indices)
Creates a suggest request for getting suggestions from provided
indices . |
static SyncedFlushRequest |
syncedFlushRequest(String... indices)
Creates a synced flush indices request.
|
static UpdateSettingsRequest |
updateSettingsRequest(String... indices)
A request to update indices settings.
|
static UpgradeRequest |
upgradeRequest(String... indices)
Creates an upgrade request.
|
static VerifyRepositoryRequest |
verifyRepositoryRequest(String name)
Verifies snapshot repository
|
public static XContentType CONTENT_TYPE
public static XContentType INDEX_CONTENT_TYPE
public static IndexRequest indexRequest()
public static IndexRequest indexRequest(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(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(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)
@Deprecated public static CountRequest countRequest(String... indices)
searchRequest(String...)
instead and set size to 0QueryBuilder
(using QueryBuilders
).indices
- The indices to count matched documents against a query. Use null or _all to execute against all indicesClient.count(org.elasticsearch.action.count.CountRequest)
@Deprecated public static ExistsRequest existsRequest(String... indices)
SearchRequest
instead and set `size` to `0` and `terminate_after` to `1`QueryBuilder
(using QueryBuilders
).indices
- The indices to count matched documents against a query. Use null or _all to execute against all indicespublic static SuggestRequest suggestRequest(String... indices)
indices
.
The suggest query has to be set using the JSON source using SuggestRequest.suggest(org.elasticsearch.common.bytes.BytesReference)
.indices
- The indices to suggest from. Use null or _all to execute against all indicesClient.suggest(org.elasticsearch.action.suggest.SuggestRequest)
public static SearchRequest searchRequest(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(String scrollId)
scrollId
- The scroll id representing the scrollable searchClient.searchScroll(org.elasticsearch.action.search.SearchScrollRequest)
public static IndicesSegmentsRequest indicesSegmentsRequest(String... indices)
public static IndicesShardStoresRequest indicesShardStoresRequest(String... indices)
indices
- The indices to get shard store information onIndicesAdminClient.shardStores(IndicesShardStoresRequest)
public static IndicesExistsRequest indicesExistsRequest(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(String index)
index
- The index to createIndicesAdminClient.create(org.elasticsearch.action.admin.indices.create.CreateIndexRequest)
public static DeleteIndexRequest deleteIndexRequest(String index)
index
- The index to deleteIndicesAdminClient.delete(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)
public static CloseIndexRequest closeIndexRequest(String index)
index
- The index to closeIndicesAdminClient.close(org.elasticsearch.action.admin.indices.close.CloseIndexRequest)
public static OpenIndexRequest openIndexRequest(String index)
index
- The index to openIndicesAdminClient.open(org.elasticsearch.action.admin.indices.open.OpenIndexRequest)
public static PutMappingRequest putMappingRequest(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(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(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(String... indices)
indices
- The indices to sync flush. Use null or _all to execute against all indicesIndicesAdminClient.syncedFlush(SyncedFlushRequest)
public static ForceMergeRequest forceMergeRequest(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(String... indices)
indices
- The indices to upgrade. Use null or _all to execute against all indicesIndicesAdminClient.upgrade(UpgradeRequest)
public static ClearIndicesCacheRequest clearIndicesCacheRequest(String... indices)
indices
- The indices to clean their caches. Use null or _all to execute against all indicespublic static UpdateSettingsRequest updateSettingsRequest(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(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(String... indices)
public static NodesInfoRequest nodesInfoRequest()
ClusterAdminClient.nodesInfo(org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest)
public static NodesInfoRequest nodesInfoRequest(String... nodesIds)
nodesIds
- The nodes ids to get the status forClusterAdminClient.nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest)
public static NodesStatsRequest nodesStatsRequest(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 CancelTasksRequest cancelTasksRequest()
ClusterAdminClient.cancelTasks(CancelTasksRequest)
public static PutRepositoryRequest putRepositoryRequest(String name)
name
- repository namepublic static GetRepositoriesRequest getRepositoryRequest(String... repositories)
repositories
- names of repositoriespublic static DeleteRepositoryRequest deleteRepositoryRequest(String name)
name
- repository namepublic static VerifyRepositoryRequest verifyRepositoryRequest(String name)
name
- repository namepublic static CreateSnapshotRequest createSnapshotRequest(String repository, String snapshot)
repository
- repository namesnapshot
- snapshot namepublic static GetSnapshotsRequest getSnapshotsRequest(String repository)
repository
- repository namepublic static RestoreSnapshotRequest restoreSnapshotRequest(String repository, String snapshot)
repository
- repository namesnapshot
- snapshot namepublic static DeleteSnapshotRequest deleteSnapshotRequest(String repository, String snapshot)
snapshot
- snapshot namerepository
- repository namepublic static SnapshotsStatusRequest snapshotsStatusRequest(String repository)
repository
- repository nameCopyright © 2009–2016. All rights reserved.