You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,22 +54,19 @@ The Elasticsearch client is compatible with currently maintained Ruby versions.
54
54
55
55
The gem's version numbers follow Elasticsearch's major versions. The `master` branch is compatible with the Elasticsearch `master` branch, which is the next major version.
56
56
57
-
| Gem Version || Elasticsearch |
58
-
|:-------------:|:-:| :-----------: |
59
-
| 0.90 | → | 0.90 |
60
-
| 1.x | → | 1.x |
61
-
| 2.x | → | 2.x |
62
-
| 5.x | → | 5.x |
63
-
| 6.x | → | 6.x |
64
-
| 7.x | → | 7.x |
65
-
| master | → | master |
66
-
67
-
Use a release that matches the major version of Elasticsearch in your stack. Each client version is
68
-
backwards compatible with all minor versions of the same major version. The client's API is
69
-
compatible with Elasticsearch's API versions from 0.90 till current.
70
-
71
-
Check out [Elastic product end of life dates](https://www.elastic.co/support/eol)
72
-
to learn which releases are still actively supported and tested.
57
+
| Client version | Elasticsearch version | Supported | Tests |
Use a release that matches the major version of Elasticsearch in your stack. Each client version is backwards compatible with all minor versions of the same major version. The client's API is compatible with Elasticsearch's API versions from 0.90 till current.
68
+
69
+
Check out [Elastic product end of life dates](https://www.elastic.co/support/eol) to learn which releases are still actively supported and tested.
Copy file name to clipboardExpand all lines: elasticsearch/README.md
+77-28Lines changed: 77 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,29 @@
2
2
3
3
The `elasticsearch` library provides a Ruby client and API for [Elasticsearch](http://elasticsearch.com).
4
4
5
+
## Usage
6
+
7
+
This gem is a wrapper for two separate libraries:
8
+
9
+
*[`elasticsearch-transport`](https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport), which provides a low-level Ruby client for connecting to [Elastic](http://elasticsearch.com) services.
10
+
*[`elasticsearch-api`](https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-api), which provides a Ruby API for the Elasticsearch RESTful API.
11
+
12
+
Install the `elasticsearch` package and use the API directly:
13
+
14
+
```ruby
15
+
require'elasticsearch'
16
+
17
+
client =Elasticsearch::Client.new(log:true)
18
+
19
+
client.cluster.health
20
+
21
+
client.transport.reload_connections!
22
+
23
+
client.search(q:'test')
24
+
25
+
# etc.
26
+
```
27
+
5
28
Features overview:
6
29
7
30
* Pluggable logging and tracing
@@ -14,25 +37,23 @@ Features overview:
14
37
* Extensive documentation and examples
15
38
* Emphasis on modularity and extendability of both the client and API libraries
16
39
17
-
(For integration with Ruby models and Rails applications,
18
-
see the <https://github.com/elasticsearch/elasticsearch-rails> project.)
40
+
(For integration with Ruby models and Rails applications, see the <https://github.com/elasticsearch/elasticsearch-rails> project.)
19
41
20
42
## Compatibility
21
43
22
-
The Elasticsearch client for Ruby is compatible with Ruby 1.9 and higher.
44
+
The Elasticsearch client is compatible with currently maintained Ruby versions. See [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/). We don't provide support to versions which have reached their end of life.
23
45
24
-
The client's API is compatible with Elasticsearch's API versions from 0.90 till current,
25
-
just use a release matching major version of Elasticsearch.
46
+
The client's API is compatible with Elasticsearch's API versions from 0.90 till current, just use a release matching major version of Elasticsearch.
26
47
27
-
|Ruby || Elasticsearch|
28
-
|:-------------:|:-:| :-----------: |
29
-
| 0.90 | → |0.90 |
30
-
| 1.x | → |1.x |
31
-
| 2.x | → |2.x |
32
-
| 5.x | → |5.x |
33
-
| 6.x | → |6.x |
34
-
| 7.x | → |7.x |
35
-
| master | → |master |
48
+
| Client version | Elasticsearch version | Supported | Tests |
which provides a Ruby API for the Elasticsearch RESTful API
80
+
### Identifying running tasks with X-Opaque-Id
62
81
63
-
Install the `elasticsearch` package and use the API directly:
82
+
The X-Opaque-Id header allows to track certain calls, or associate certain tasks with the client that started them ([more on the Elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks)). To use this feature, you need to set an id for `opaque_id` on the client on each request. Example:
The search request will include the following HTTP Header:
89
+
```
90
+
X-Opaque-Id: 123456
91
+
```
67
92
68
-
client =Elasticsearch::Client.newlog:true
93
+
You can also set a prefix for X-Opaque-Id when initializing the client. This will be prepended to the id you set before each request if you're using X-Opaque-Id. Example:
0 commit comments