Skip to content

Commit a762819

Browse files
authored
[DOCS] Restructures repo readme (elastic#2154)
1 parent 1f4c770 commit a762819

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

README.md

+30-24
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,50 @@ This repository contains the official [Elasticsearch](https://www.elastic.co/pro
88

99
## Documentation
1010

11-
Please refer to [the full documentation on elastic.co](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html) for comprehensive information.
11+
Please refer to
12+
[the full documentation on elastic.co](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html)
13+
for comprehensive information.
1214

13-
Both `elastic-transport` and `elasticsearch-api` are also documented. You can check the [`elastic-transport`](https://rubydoc.info/github/elastic/elastic-transport-ruby/) and the [`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api) documentation at RubyDocs.
15+
Both `elastic-transport` and `elasticsearch-api` are documented. You can check
16+
the [`elastic-transport`](https://rubydoc.info/github/elastic/elastic-transport-ruby/)
17+
and the [`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api)
18+
documentation at RubyDocs.
1419

1520
## Installation
1621

17-
Install the `elasticsearch` gem from [Rubygems](https://rubygems.org/gems/elasticsearch):
18-
19-
```
20-
$ gem install elasticsearch
21-
```
22-
23-
Or add it to your project's Gemfile:
24-
2522
```ruby
26-
gem 'elasticsearch', 'VERSION'
23+
gem install elasticsearch
2724
```
2825

29-
## Usage example
30-
31-
```ruby
32-
require 'elasticsearch'
33-
34-
client = Elasticsearch::Client.new(log: true)
26+
Refer to the [Installation section](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_installation)
27+
of the getting started documentation.
3528

36-
# if you specify Elasticsearch host
37-
# client = Elasticsearch::Client.new url: 'http://localhost:9200', log: true
29+
## Connecting
3830

39-
client.transport.reload_connections!
31+
Refer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_connecting)
32+
of the getting started documentation.
4033

41-
client.cluster.health
34+
## Usage
4235

36+
```ruby
37+
require 'elasticsearch'
38+
client = Elasticsearch::Client.new(host: 'https://my-elasticsearch-host.example')
39+
client.ping
4340
client.search(q: 'test')
44-
45-
# etc.
4641
```
4742

48-
See also [the official documentation](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/examples.html) for examples of how to use the most frequently called APIs and [`doc/examples`](https://github.com/elastic/elasticsearch-ruby/blob/main/docs/examples/) for some practical examples.
43+
* [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_creating_an_index)
44+
* [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_indexing_documents)
45+
* [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_getting_documents)
46+
* [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_searching_documents)
47+
* [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_updating_documents)
48+
* [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_deleting_documents)
49+
* [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/getting-started-ruby.html#_deleting_an_index)
50+
51+
Refer to [the official documentation](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/examples.html)
52+
for examples of how to use the most frequently called APIs and
53+
[`doc/examples`](https://github.com/elastic/elasticsearch-ruby/blob/main/docs/examples/)
54+
for some practical examples.
4955

5056
**For optimal performance, you should use a HTTP library which supports persistent ("keep-alive") connections, e.g. [Patron](https://github.com/toland/patron) or [Typhoeus](https://github.com/typhoeus/typhoeus).** These libraries are not dependencies of the Elasticsearch gems. Ensure you define a dependency for a HTTP library in your own application.
5157

0 commit comments

Comments
 (0)