Skip to content

Commit 1ff926c

Browse files
authored
Merge pull request #195 from szabosteve/drs.overview
2 parents d732316 + 82ad9ce commit 1ff926c

File tree

3 files changed

+141
-115
lines changed

3 files changed

+141
-115
lines changed

docs/index.asciidoc

Lines changed: 4 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,13 @@
11
= Elasticsearch.pm
22

3-
== Overview
3+
:doctype: book
44

5-
Search::Elasticsearch is the official Perl API for Elasticsearch. The full
6-
documentation is available on https://metacpan.org/module/Search::Elasticsearch.
5+
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
76

8-
It can be installed with:
7+
include::overview.asciidoc[]
98

10-
[source,sh]
11-
------------------------------------
12-
cpanm Search::Elasticsearch
13-
------------------------------------
9+
include::installation.asciidoc[]
1410

15-
=== Features
16-
17-
This client provides:
18-
19-
* Full support for all Elasticsearch APIs
20-
21-
* HTTP backend (blocking and asynchronous with https://metacpan.org/module/Search::Elasticsearch::Async)
22-
23-
* Robust networking support which handles load balancing, failure detection and failover
24-
25-
* Good defaults
26-
27-
* Helper utilities for more complex operations, such as bulk indexing, scrolled searches and reindexing.
28-
29-
* Logging support via Log::Any
30-
31-
* Compatibility with the official clients for Python, Ruby, PHP and JavaScript
32-
33-
* Easy extensibility
34-
35-
== Synopsis
36-
37-
[source,perl]
38-
------------------------------------
39-
use Search::Elasticsearch;
40-
41-
# Connect to localhost:9200:
42-
my $e = Search::Elasticsearch->new();
43-
44-
# Round-robin between two nodes:
45-
my $e = Search::Elasticsearch->new(
46-
nodes => [
47-
'search1:9200',
48-
'search2:9200'
49-
]
50-
);
51-
52-
# Connect to cluster at search1:9200, sniff all nodes and round-robin between them:
53-
my $e = Search::Elasticsearch->new(
54-
nodes => 'search1:9200',
55-
cxn_pool => 'Sniff'
56-
);
57-
58-
# Index a document:
59-
$e->index(
60-
index => 'my_app',
61-
type => 'blog_post',
62-
id => 1,
63-
body => {
64-
title => 'Elasticsearch clients',
65-
content => 'Interesting content...',
66-
date => '2014-09-24'
67-
}
68-
);
69-
70-
# Get the document:
71-
my $doc = $e->get(
72-
index => 'my_app',
73-
type => 'blog_post',
74-
id => 1
75-
);
76-
77-
# Search:
78-
my $results = $e->search(
79-
index => 'my_app',
80-
body => {
81-
query => {
82-
match => { title => 'elasticsearch' }
83-
}
84-
}
85-
);
86-
------------------------------------
87-
88-
[[v0_90]]
89-
== Elasticsearch 0.90.* and earlier
90-
91-
The current version of the client supports the Elasticsearch 1.0 branch by
92-
default, which is not backwards compatible with the 0.90 branch.
93-
94-
If you need to talk to a version of Elasticsearch before 1.0.0,
95-
please use `Search::Elasticsearch::Client::0_90::Direct` as follows:
96-
97-
[source,perl]
98-
------------------------------------
99-
$es = Search::Elasticsearch->new(
100-
client => '0_90::Direct'
101-
);
102-
------------------------------------
103-
104-
105-
== Reporting issues
106-
107-
The GitHub repository is https://github.com/elastic/elasticsearch-perl
108-
and any issues can be reported on the issues list at
109-
https://github.com/elastic/elasticsearch-perl/issues.
110-
111-
== Contributing
112-
113-
Open source contributions are welcome. Please read our
114-
https://github.com/elastic/elasticsearch-perl/blob/master/CONTRIBUTING.asciidoc[guide to contributing].
115-
116-
== Copyright and License
117-
118-
This software is Copyright (c) 2013-2018 by Elasticsearch BV.
119-
120-
This is free software, licensed under:
121-
https://github.com/elastic/elasticsearch-perl/blob/master/LICENSE.txt[The Apache License Version 2.0].
12211

12312

12413

docs/installation.asciidoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[installation]]
2+
== Installation
3+
4+
You can install the latest stable release of the Perl Client by using the
5+
following command:
6+
7+
[source,sh]
8+
------------------------------------
9+
cpanm Search::Elasticsearch
10+
------------------------------------
11+
12+
To install a specific version, download the specific version artifact. For
13+
example, to download elasticsearch-perl 6.81, use the following command:
14+
15+
[source,sh]
16+
------------------------------------
17+
cpanm EZIMUEL/Search-Elasticsearch-6.81.tar.gz
18+
------------------------------------

docs/overview.asciidoc

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
== Overview
2+
3+
Search::Elasticsearch is the official Perl API for {es}. You can find the full
4+
documentation https://metacpan.org/module/Search::Elasticsearch[here].
5+
6+
The intention of this client is to provide unopinionated and robust support for
7+
the full native {es} API.
8+
9+
=== Features
10+
11+
This client provides:
12+
13+
* Full support for all {es} APIs.
14+
15+
* HTTP backend (blocking and asynchronous with
16+
https://metacpan.org/module/Search::Elasticsearch::Async).
17+
18+
* Robust networking support which handles load balancing, failure detection and
19+
failover.
20+
21+
* Good defaults.
22+
23+
* Helper utilities for more complex operations, such as bulk indexing, scrolled
24+
searches and reindexing.
25+
26+
* Logging support via Log::Any.
27+
28+
* Compatibility with the official clients for Python, Ruby, PHP and JavaScript.
29+
30+
* Easy extensibility.
31+
32+
33+
=== Synopsis
34+
35+
[source,perl]
36+
------------------------------------
37+
use Search::Elasticsearch;
38+
39+
# Connect to localhost:9200:
40+
my $e = Search::Elasticsearch->new();
41+
42+
# Round-robin between two nodes:
43+
my $e = Search::Elasticsearch->new(
44+
nodes => [
45+
'search1:9200',
46+
'search2:9200'
47+
]
48+
);
49+
50+
# Connect to cluster at search1:9200, sniff all nodes and round-robin between them:
51+
my $e = Search::Elasticsearch->new(
52+
nodes => 'search1:9200',
53+
cxn_pool => 'Sniff'
54+
);
55+
56+
# Index a document:
57+
$e->index(
58+
index => 'my_app',
59+
type => 'blog_post',
60+
id => 1,
61+
body => {
62+
title => 'Elasticsearch clients',
63+
content => 'Interesting content...',
64+
date => '2014-09-24'
65+
}
66+
);
67+
68+
# Get the document:
69+
my $doc = $e->get(
70+
index => 'my_app',
71+
type => 'blog_post',
72+
id => 1
73+
);
74+
75+
# Search:
76+
my $results = $e->search(
77+
index => 'my_app',
78+
body => {
79+
query => {
80+
match => { title => 'elasticsearch' }
81+
}
82+
}
83+
);
84+
------------------------------------
85+
86+
[[v0_90]]
87+
=== Elasticsearch 0.90.* and earlier
88+
89+
The current version of the client supports the Elasticsearch 1.0 branch by
90+
default, which is not backwards compatible with the 0.90 branch.
91+
92+
If you need to talk to a version of Elasticsearch before 1.0.0,
93+
please use `Search::Elasticsearch::Client::0_90::Direct` as follows:
94+
95+
[source,perl]
96+
------------------------------------
97+
$es = Search::Elasticsearch->new(
98+
client => '0_90::Direct'
99+
);
100+
------------------------------------
101+
102+
103+
=== Reporting issues
104+
105+
The GitHub repository is https://github.com/elastic/elasticsearch-perl and any
106+
issues can be reported on the issues list at
107+
https://github.com/elastic/elasticsearch-perl/issues.
108+
109+
=== Contributing
110+
111+
Open source contributions are welcome. Please read our
112+
https://github.com/elastic/elasticsearch-perl/blob/master/CONTRIBUTING.asciidoc[guide to contributing].
113+
114+
=== Copyright and License
115+
116+
This software is Copyright (c) 2013-2018 by Elasticsearch BV.
117+
118+
This is free software, licensed under:
119+
https://github.com/elastic/elasticsearch-perl/blob/master/LICENSE.txt[The Apache License Version 2.0].

0 commit comments

Comments
 (0)