Doc updates (#791)
Updates for better displaying the documentation in the website.
This commit is contained in:
committed by
delvedor
parent
081cac4813
commit
3d85d85e2d
@ -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[]
|
||||
|
||||
Reference in New Issue
Block a user