Crate elastic_requests [] [src]

Elasticsearch Request Types

An implementation of the Elasticsearch REST API using strong types for endpoints.

The source is automatically generated from the official spec. A struct is provided for each endpoint that works with borrowed or owned data. There's also a more general HttpRequest type that all requests can be converted into.

Supported Versions

elastic_requests Elasticsearch
0.x 5.x

Usage

All request types provide constructor functions of the form param_1_param_2_param_n:

let req = SearchRequest::for_index_ty(
    "test_index",
    "test_ty",
    "{'query': { 'match_all': {}}}"
);

assert_eq!("/test_index/test_ty/_search", req.url.as_ref());

Or new if the endpoint takes no parameters:

let req = PingRequest::new();

assert_eq!("/", req.url.as_ref());

Parameters can be borrowed or owned string values:

let req = SearchRequest::for_index(
    "test_index".to_string(),
    "{'query': { 'match_all': {}}}"
);

assert_eq!("/test_index/_search", req.url.as_ref());

Why are these docs useless?

This library is automatically generated, so there's a lot more work to do to get the documentation up to scratch.

Links

Structs

Alias
Body
BulkRequest
CatAliasesRequest
CatAllocationRequest
CatCountRequest
CatFielddataRequest
CatHealthRequest
CatHelpRequest
CatIndicesRequest
CatMasterRequest
CatNodeattrsRequest
CatNodesRequest
CatPendingTasksRequest
CatPluginsRequest
CatRecoveryRequest
CatRepositoriesRequest
CatSegmentsRequest
CatShardsRequest
CatSnapshotsRequest
CatTasksRequest
CatTemplatesRequest
CatThreadPoolRequest
ClearScrollRequest
ClusterAllocationExplainRequest
ClusterGetSettingsRequest
ClusterHealthRequest
ClusterPendingTasksRequest
ClusterPutSettingsRequest
ClusterRerouteRequest
ClusterStateRequest
ClusterStatsRequest
CountPercolateRequest
CountRequest
CreateRequest
DeleteByQueryRequest
DeleteRequest
DeleteScriptRequest
DeleteTemplateRequest
ExistsRequest
ExplainRequest
Feature
FieldStatsRequest
Fields
GetRequest
GetScriptRequest
GetSourceRequest
GetTemplateRequest
HttpRequest
Id
Index
IndexMetric
IndexRequest
IndicesAnalyzeRequest
IndicesClearCacheRequest
IndicesCloseRequest
IndicesCreateRequest
IndicesDeleteAliasRequest
IndicesDeleteRequest
IndicesDeleteTemplateRequest
IndicesExistsAliasRequest
IndicesExistsRequest
IndicesExistsTemplateRequest
IndicesExistsTypeRequest
IndicesFlushRequest
IndicesFlushSyncedRequest
IndicesForcemergeRequest
IndicesGetAliasRequest
IndicesGetFieldMappingRequest
IndicesGetMappingRequest
IndicesGetRequest
IndicesGetSettingsRequest
IndicesGetTemplateRequest
IndicesGetUpgradeRequest
IndicesOpenRequest
IndicesPutAliasRequest
IndicesPutMappingRequest
IndicesPutSettingsRequest
IndicesPutTemplateRequest
IndicesRecoveryRequest
IndicesRefreshRequest
IndicesRolloverRequest
IndicesSegmentsRequest
IndicesShardStoresRequest
IndicesShrinkRequest
IndicesStatsRequest
IndicesUpdateAliasesRequest
IndicesUpgradeRequest
IndicesValidateQueryRequest
InfoRequest
IngestDeletePipelineRequest
IngestGetPipelineRequest
IngestPutPipelineRequest
IngestSimulateRequest
Lang
Metric
MgetRequest
MpercolateRequest
MsearchRequest
MsearchTemplateRequest
MtermvectorsRequest
Name
NewIndex
NodeId
NodesHotThreadsRequest
NodesInfoRequest
NodesStatsRequest
PercolateRequest
PingRequest
PutScriptRequest
PutTemplateRequest
ReindexRequest
ReindexRethrottleRequest
RenderSearchTemplateRequest
Repository
ScrollId
ScrollRequest
SearchRequest
SearchShardsRequest
SearchTemplateRequest
SimpleSearchRequest
Snapshot
SnapshotCreateRepositoryRequest
SnapshotCreateRequest
SnapshotDeleteRepositoryRequest
SnapshotDeleteRequest
SnapshotGetRepositoryRequest
SnapshotGetRequest
SnapshotRestoreRequest
SnapshotStatusRequest
SnapshotVerifyRepositoryRequest
SuggestRequest
Target
TaskId
TasksCancelRequest
TasksGetRequest
TasksListRequest
TermvectorsRequest
ThreadPoolPatterns
Type
UpdateByQueryRequest
UpdateRequest
Url

Enums

HttpMethod

Traits

RawBody

Get a borrowed or owned slice of bytes.