java.lang.Object
org.elasticsearch.client.internal.Requests
A handy one stop shop for creating requests (make sure to import static this class).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic XContentTypeThe content type used to generate request builders (query / search).static XContentTypeThe default content type to use to generate source documents when indexing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BulkRequestCreates a new bulk request.static CancelTasksRequestCreates a nodes tasks request against one or more nodes.static CleanupRepositoryRequestCleanup repositorystatic ClearIndicesCacheRequestclearIndicesCacheRequest(String... indices) Creates a clean indices cache request.static CloseIndexRequestcloseIndexRequest(String index) Creates a close index request.static ClusterHealthRequestclusterHealthRequest(String... indices) Creates a cluster health request.static ClusterRerouteRequeststatic ClusterSearchShardsRequestList all shards for the give searchstatic ClusterSearchShardsRequestclusterSearchShardsRequest(String... indices) List all shards for the give searchstatic ClusterStateRequestCreates a cluster state request.static ClusterStatsRequestCreates a cluster stats request.static ClusterUpdateSettingsRequeststatic CreateIndexRequestcreateIndexRequest(String index) Creates a create index request.static CreateSnapshotRequestcreateSnapshotRequest(String repository, String snapshot) Creates new snapshotstatic DeleteIndexRequestdeleteIndexRequest(String index) Creates a delete index request.static DeleteRepositoryRequestDeletes registration for snapshot repositorystatic DeleteRequestdeleteRequest(String index) Creates a delete request against a specific index.static DeleteSnapshotRequestdeleteSnapshotRequest(String repository, String... snapshots) Deletes snapshotsstatic FlushRequestflushRequest(String... indices) Creates a flush indices request.static ForceMergeRequestforceMergeRequest(String... indices) Creates a force merge request.static GetRepositoriesRequestgetRepositoryRequest(String... repositories) Gets snapshot repositorystatic GetRequestgetRequest(String index) Creates a get request to get the JSON source from an index based on a type and id.static GetSnapshotsRequestgetSnapshotsRequest(String... repositories) Gets snapshots from repositoriesstatic GetTaskRequestCreates a get task request.static IndicesAliasesRequestCreates an index aliases request allowing to add and remove aliases.static IndexRequeststatic IndexRequestindexRequest(String index) Create an index request against a specific index.static IndicesSegmentsRequestindicesSegmentsRequest(String... indices) static IndicesShardStoresRequestindicesShardStoresRequest(String... indices) Creates an indices shard stores info request.static ListTasksRequestCreates a nodes tasks request against all the nodes.static NodesInfoRequestCreates a nodes info request against all the nodes.static NodesInfoRequestnodesInfoRequest(String... nodesIds) Creates a nodes info request against one or more nodes.static NodesStatsRequestnodesStatsRequest(String... nodesIds) Creates a nodes stats request against one or more nodes.static NodesUsageRequestnodesUsageRequest(String... nodesIds) Creates a nodes usage request against one or more nodes.static OpenIndexRequestopenIndexRequest(String index) Creates an open index request.static PutMappingRequestputMappingRequest(String... indices) Create a create mapping request against one or more indices.static PutRepositoryRequestputRepositoryRequest(String name) Registers snapshot repositorystatic RefreshRequestrefreshRequest(String... indices) Creates a refresh indices request.static RestoreSnapshotRequestrestoreSnapshotRequest(String repository, String snapshot) Restores new snapshotstatic SearchRequestsearchRequest(String... indices) Creates a search request against one or more indices.static SearchScrollRequestsearchScrollRequest(String scrollId) Creates a search scroll request allowing to continue searching a previous search request.static SnapshotsStatusRequestsnapshotsStatusRequest(String repository) Get status of snapshotsstatic UpdateSettingsRequestupdateSettingsRequest(String... indices) A request to update indices settings.static VerifyRepositoryRequestVerifies snapshot repository
-
Field Details
-
CONTENT_TYPE
The content type used to generate request builders (query / search). -
INDEX_CONTENT_TYPE
The default content type to use to generate source documents when indexing.
-
-
Constructor Details
-
Requests
public Requests()
-
-
Method Details
-
indexRequest
-
indexRequest
Create an index request against a specific index.- Parameters:
index- The index name to index the request against- Returns:
- The index request
- See Also:
-
deleteRequest
Creates a delete request against a specific index. Note theDeleteRequest.id(String)must be set.- Parameters:
index- The index name to delete from- Returns:
- The delete request
- See Also:
-
bulkRequest
Creates a new bulk request. -
getRequest
Creates a get request to get the JSON source from an index based on a type and id. Note, theGetRequest.id(String)must be set.- Parameters:
index- The index to get the JSON source from- Returns:
- The get request
- See Also:
-
searchRequest
Creates a search request against one or more indices. Note, the search source must be set either using the actual JSON search source, or theSearchSourceBuilder.- Parameters:
indices- The indices to search against. Usenullor_allto execute against all indices- Returns:
- The search request
- See Also:
-
searchScrollRequest
Creates a search scroll request allowing to continue searching a previous search request.- Parameters:
scrollId- The scroll id representing the scrollable search- Returns:
- The search scroll request
- See Also:
-
indicesSegmentsRequest
-
indicesShardStoresRequest
Creates an indices shard stores info request.- Parameters:
indices- The indices to get shard store information on- Returns:
- The indices shard stores request
- See Also:
-
createIndexRequest
Creates a create index request.- Parameters:
index- The index to create- Returns:
- The index create request
- See Also:
-
deleteIndexRequest
Creates a delete index request.- Parameters:
index- The index to delete- Returns:
- The delete index request
- See Also:
-
closeIndexRequest
Creates a close index request.- Parameters:
index- The index to close- Returns:
- The delete index request
- See Also:
-
openIndexRequest
Creates an open index request.- Parameters:
index- The index to open- Returns:
- The delete index request
- See Also:
-
putMappingRequest
Create a create mapping request against one or more indices.- Parameters:
indices- The indices to create mapping. Usenullor_allto execute against all indices- Returns:
- The create mapping request
- See Also:
-
indexAliasesRequest
Creates an index aliases request allowing to add and remove aliases.- Returns:
- The index aliases request
-
refreshRequest
Creates a refresh indices request.- Parameters:
indices- The indices to refresh. Usenullor_allto execute against all indices- Returns:
- The refresh request
- See Also:
-
flushRequest
Creates a flush indices request.- Parameters:
indices- The indices to flush. Usenullor_allto execute against all indices- Returns:
- The flush request
- See Also:
-
forceMergeRequest
Creates a force merge request.- Parameters:
indices- The indices to force merge. Usenullor_allto execute against all indices- Returns:
- The force merge request
- See Also:
-
clearIndicesCacheRequest
Creates a clean indices cache request.- Parameters:
indices- The indices to clean their caches. Usenullor_allto execute against all indices- Returns:
- The request
-
updateSettingsRequest
A request to update indices settings.- Parameters:
indices- The indices to update the settings for. Usenullor_allto executed against all indices.- Returns:
- The request
-
clusterStateRequest
Creates a cluster state request.- Returns:
- The cluster state request.
- See Also:
-
clusterRerouteRequest
-
clusterUpdateSettingsRequest
-
clusterHealthRequest
Creates a cluster health request.- Parameters:
indices- The indices to provide additional cluster health information for. Usenullor_allto execute against all indices- Returns:
- The cluster health request
- See Also:
-
clusterSearchShardsRequest
List all shards for the give search -
clusterSearchShardsRequest
List all shards for the give search -
nodesInfoRequest
Creates a nodes info request against all the nodes.- Returns:
- The nodes info request
- See Also:
-
nodesInfoRequest
Creates a nodes info request against one or more nodes. Passnullor an empty array for all nodes.- Parameters:
nodesIds- The nodes ids to get the status for- Returns:
- The nodes info request
- See Also:
-
nodesStatsRequest
Creates a nodes stats request against one or more nodes. Passnullor an empty array for all nodes.- Parameters:
nodesIds- The nodes ids to get the stats for- Returns:
- The nodes info request
- See Also:
-
nodesUsageRequest
Creates a nodes usage request against one or more nodes. Passnullor an empty array for all nodes.- Parameters:
nodesIds- The nodes ids to get the usage for- Returns:
- The nodes usage request
- See Also:
-
clusterStatsRequest
Creates a cluster stats request.- Returns:
- The cluster stats request
- See Also:
-
listTasksRequest
Creates a nodes tasks request against all the nodes.- Returns:
- The nodes tasks request
- See Also:
-
getTaskRequest
Creates a get task request.- Returns:
- The nodes tasks request
- See Also:
-
cancelTasksRequest
Creates a nodes tasks request against one or more nodes. Passnullor an empty array for all nodes.- Returns:
- The nodes tasks request
- See Also:
-
putRepositoryRequest
Registers snapshot repository- Parameters:
name- repository name- Returns:
- repository registration request
-
getRepositoryRequest
Gets snapshot repository- Parameters:
repositories- names of repositories- Returns:
- get repository request
-
deleteRepositoryRequest
Deletes registration for snapshot repository- Parameters:
name- repository name- Returns:
- delete repository request
-
cleanupRepositoryRequest
Cleanup repository- Parameters:
name- repository name- Returns:
- cleanup repository request
-
verifyRepositoryRequest
Verifies snapshot repository- Parameters:
name- repository name- Returns:
- repository verification request
-
createSnapshotRequest
Creates new snapshot- Parameters:
repository- repository namesnapshot- snapshot name- Returns:
- create snapshot request
-
getSnapshotsRequest
Gets snapshots from repositories- Parameters:
repositories- repository names- Returns:
- get snapshot request
-
restoreSnapshotRequest
Restores new snapshot- Parameters:
repository- repository namesnapshot- snapshot name- Returns:
- snapshot creation request
-
deleteSnapshotRequest
Deletes snapshots- Parameters:
snapshots- snapshot namesrepository- repository name- Returns:
- delete snapshot request
-
snapshotsStatusRequest
Get status of snapshots- Parameters:
repository- repository name- Returns:
- snapshot status request
-