-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for better displaying the documentation in the website.
- Loading branch information
Showing
23 changed files
with
516 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
= Exists | ||
[[exists_examples]] | ||
== Exists | ||
|
||
Check that the document `/game-of-thrones/1` exists. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[[ignore_examples]] | ||
== Ignore | ||
HTTP status codes which should not be considered errors for this request. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[[examples]] | ||
= Examples | ||
|
||
Following you can find some examples on how to use the client. | ||
|
||
* Use of the <<as_stream_examples,asStream>> parameter; | ||
* Executing a <<bulk_examples,bulk>> request; | ||
* Executing a <<exists_examples,exists>> request; | ||
* Executing a <<get_examples,get>> request; | ||
* Use of the <<ignore_examples,ignore>> parameter; | ||
* Executing a <<msearch_examples,msearch>> request; | ||
* How do I <<scroll_examples,scroll>>? | ||
* Executing a <<search_examples,search>> request; | ||
* I need <<suggest_examples,suggestions>>; | ||
* How to use the <<transport_request_examples,transport.request>> method; | ||
* How to use <<typescript_examples,TypeScript>>; | ||
|
||
include::asStream.asciidoc[] | ||
include::bulk.asciidoc[] | ||
include::exists.asciidoc[] | ||
include::get.asciidoc[] | ||
include::ignore.asciidoc[] | ||
include::msearch.asciidoc[] | ||
include::scroll.asciidoc[] | ||
include::search.asciidoc[] | ||
include::suggest.asciidoc[] | ||
include::transport.request.asciidoc[] | ||
include::typescript.asciidoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,12 @@ | ||
= @elastic/elasticsearch | ||
|
||
The official Node.js client for Elasticsearch. | ||
|
||
== Features | ||
* One-to-one mapping with REST API. | ||
* Generalized, pluggable architecture. | ||
* Configurable, automatic discovery of cluster nodes. | ||
* Persistent, Keep-Alive connections. | ||
* Load balancing (with pluggable selection strategy) across all available nodes. | ||
* TypeScript support out of the box. | ||
|
||
== Install | ||
[source,sh] | ||
---- | ||
npm install @elastic/elasticsearch | ||
---- | ||
By default the latest version of the module will be installed, which is the same version of the current release of Elasticsearch. + | ||
If you need to work with older versions of Elasticsearch, you should install the same version of the client as well. + | ||
For example, if you are using Elasticsearch `v6.5.4`, you will need the client `v6`, and you can easily do that with `npm install @elastic/elasticsearch@6`. | ||
|
||
== Usage | ||
[source,js] | ||
---- | ||
const { Client } = require('@elastic/elasticsearch') | ||
const client = new Client({ node: 'http://localhost:9200' }) | ||
// promise API | ||
const result = await client.search({ | ||
index: 'my-index', | ||
body: { foo: 'bar' } | ||
}) | ||
// callback API | ||
client.search({ | ||
index: 'my-index', | ||
body: { foo: 'bar' } | ||
}, (err, result) => { | ||
if (err) console.log(err) | ||
}) | ||
---- | ||
|
||
== Reference | ||
* Client configuration | ||
* Client usage | ||
* API methods | ||
* TypeScript support | ||
* Extend the client | ||
* Breaking changes from old client | ||
* Authentication | ||
* Child client | ||
include::introduction.asciidoc[] | ||
include::usage.asciidoc[] | ||
include::configuration.asciidoc[] | ||
include::reference.asciidoc[] | ||
include::breaking-changes.asciidoc[] | ||
include::authentication.asciidoc[] | ||
include::child.asciidoc[] | ||
include::extend.asciidoc[] | ||
include::typescript.asciidoc[] | ||
include::examples/index.asciidoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
== Introduction | ||
|
||
The official Node.js client for Elasticsearch. | ||
|
||
=== Features | ||
* One-to-one mapping with REST API. | ||
* Generalized, pluggable architecture. | ||
* Configurable, automatic discovery of cluster nodes. | ||
* Persistent, Keep-Alive connections. | ||
* Load balancing (with pluggable selection strategy) across all available nodes. | ||
* TypeScript support out of the box. | ||
|
||
=== Install | ||
[source,sh] | ||
---- | ||
npm install @elastic/elasticsearch | ||
---- | ||
|
||
=== Compatibility | ||
|
||
The library is compatible with all Elasticsearch versions since 5.x, but you should use the same major version of the Elasticsearch instance that you are using. | ||
---- | ||
# Elasticsearch 7.x | ||
@elastic/elasticsearch@7 | ||
# Elasticsearch 6.x | ||
@elastic/elasticsearch@6 | ||
# Elasticsearch 5.x | ||
@elastic/elasticsearch@5 | ||
---- | ||
|
||
=== Usage | ||
[source,js] | ||
---- | ||
const { Client } = require('@elastic/elasticsearch') | ||
const client = new Client({ node: 'http://localhost:9200' }) | ||
// promise API | ||
const result = await client.search({ | ||
index: 'my-index', | ||
body: { foo: 'bar' } | ||
}) | ||
// callback API | ||
client.search({ | ||
index: 'my-index', | ||
body: { foo: 'bar' } | ||
}, (err, result) => { | ||
if (err) console.log(err) | ||
}) | ||
---- |
Oops, something went wrong.