Updated API reference doc (#945)

* Updated API reference doc

* Updated docs script
This commit is contained in:
Tomas Della Vedova
2019-09-16 17:41:36 +02:00
committed by GitHub
parent 69247496ce
commit ce584b3211
2 changed files with 72 additions and 0 deletions

View File

@ -11,6 +11,42 @@ function generateDocs (common, spec) {
[[api-reference]]
== API Reference
This document contains the entire list of the Elasticsearch API supported by the client, both OSS and commercial. The client is entirely licensed under Apache 2.0.
Elasticsearch exposes an HTTP layer to communicate with, and the client is a library that will help you do this. Because of this reason, you will see HTTP related parameters, such as ${'`'}body${'`'} or ${'`'}headers${'`'}.
Every API can accept two objects, the first contains all the parameters that will be sent to Elasticsearch, while the second includes the request specific parameters, such as timeouts, headers, and so on.
In the first object, every parameter but the body will be sent via querystring or url parameter, depending on the API, and every unrecognized parameter will be sent as querystring.
[source,js]
----
// promise API
const result = await client.search({
index: 'my-index',
from: 20,
size: 10,
body: { foo: 'bar' }
}, {
ignore: [404],
maxRetries: 3
})
// calback API
client.search({
index: 'my-index',
from: 20,
size: 10,
body: { foo: 'bar' }
}, {
ignore: [404],
maxRetries: 3
}, (err, result) => {
if (err) console.log(err)
})
----
In this document, you will find the reference of every parameter accepted by the querystring or the url. If you also need to send the body, you can find the documentation of its format in the reference link that is present along with every endpoint.
////////
This documentation is generated by running: