Skip to content

Commit

Permalink
Merge pull request #244 from colleenmcginnis/migrate-docs
Browse files Browse the repository at this point in the history
[docs] Migrate docs from AsciiDoc to Markdown
  • Loading branch information
marciw authored Feb 27, 2025
2 parents fb19967 + ba5b668 commit 39ea85d
Show file tree
Hide file tree
Showing 7 changed files with 537 additions and 61 deletions.
485 changes: 485 additions & 0 deletions docs/docset.yml

Large diffs are not rendered by default.

Binary file removed docs/images/logo.png
Binary file not shown.
6 changes: 0 additions & 6 deletions docs/index.asciidoc

This file was deleted.

20 changes: 0 additions & 20 deletions docs/installation.asciidoc

This file was deleted.

63 changes: 28 additions & 35 deletions docs/overview.asciidoc → docs/reference/index.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,64 @@
[[overview]]
== Overview
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/overview.html
- https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/index.html
navigation_title: Rust
---

This is the official Rust client for {es}. Full documentation is hosted on
https://docs.rs/elasticsearch[docs.rs] -- this page provides _only_ an overview.
# Elasticsearch Rust Client [overview]

This is the official Rust client for {{es}}. Full documentation is hosted on [docs.rs](https://docs.rs/elasticsearch) — this page provides *only* an overview.

Further resources:

* https://github.com/elastic/elasticsearch-rs[Source code]
* https://docs.rs/elasticsearch[API documentation]
* [Source code](https://github.com/elastic/elasticsearch-rs)
* [API documentation](https://docs.rs/elasticsearch)


[discrete]
[[features]]
=== Features
## Features [features]

* Fluent builders for all {es} REST API endpoints
* Fluent builders for all {{es}} REST API endpoints
* Persistent keep-alive connections
* TLS support with system or custom certificates
* Proxy support with authentication
* Async support with Tokio


[discrete]
=== {es} Version Compatibility
## {{es}} Version compatibility [_es_version_compatibility]

The Elasticsearch Rust client is forward compatible; meaning that the client supports communicating with greater minor versions of Elasticsearch. Elasticsearch language clients are also backwards compatible with lesser supported minor Elasticsearch versions.


[discrete]
=== Create a client
## Create a client [_create_a_client]

To create a client to make API calls to Elasticsearch running on `\https://localhost:9200`

[source,rust]
----
```rust
let client = Elasticsearch::default();
----
```

Alternatively, you can create a client to make API calls against Elasticsearch running on a
specific `url::Url`
Alternatively, you can create a client to make API calls against Elasticsearch running on a specific `url::Url`

[source,rust]
----
```rust
let transport = Transport::single_node("https://example.com")?;
let client = Elasticsearch::new(transport);
----
```

If you're running against an Elasticsearch deployment in https://www.elastic.co/cloud/[Elastic Cloud],
a client can be created using a https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html[Cloud ID]
and credentials retrieved from the Cloud web console
If you’re running against an Elasticsearch deployment in [Elastic Cloud](https://www.elastic.co/cloud/), a client can be created using a [Cloud ID](docs-content://deploy-manage/deploy/elastic-cloud/find-cloud-id.md) and credentials retrieved from the Cloud web console

[source,rust]
----
```rust
let cloud_id = "<cloud id from cloud web console>";
let credentials = Credentials::Basic("<username>".into(), "<password>".into());
let transport = Transport::cloud(cloud_id, credentials)?;
let client = Elasticsearch::new(transport);
----
```


[discrete]
=== Making API calls
## Making API calls [_making_api_calls]

The following makes an API call to `tweets/_search` with the json body
`{"query":{"match":{"message":"Elasticsearch"}}}`
The following makes an API call to `tweets/_search` with the json body `{"query":{"match":{"message":"Elasticsearch"}}}`

[source,rust]
----
```rust
let response = client
.search(SearchParts::Index(&["tweets"]))
.from(0)
Expand All @@ -87,4 +79,5 @@ for hit in response_body["hits"]["hits"].as_array().unwrap() {
// print the source document
println!("{:?}", hit["_source"]);
}
----
```

21 changes: 21 additions & 0 deletions docs/reference/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/installation.html
---

# Installation [installation]

Add `elasticsearch` crate and version to Cargo.toml. Choose the version that is compatible with the version of {{es}} you are using:

```toml
[dependencies]
elasticsearch = "8.7.0-alpha.1"
```

The following *optional* dependencies may also be useful to create requests and read responses:

```toml
serde = "~1"
serde_json = "~1"
```

3 changes: 3 additions & 0 deletions docs/reference/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
toc:
- file: index.md
- file: installation.md

0 comments on commit 39ea85d

Please sign in to comment.