in scripts/utils/generateDocs.js [41:121]
function generateDocs (common, spec) {
let doc = dedent`
[[api-reference]]
////////
===========================================================================================================================
|| ||
|| ||
|| ||
|| ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ ||
|| ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ ||
|| ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ ||
|| ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ||
|| ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ ||
|| ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ||
|| ||
|| ||
|| This file is autogenerated, DO NOT send pull requests that changes this file directly. ||
|| You should update the script that does the generation, which can be found in '/scripts/utils/generateDocs.js'. ||
|| ||
|| You can run the script with the following command: ||
|| node scripts/generate --branch <branch_name> ||
|| or ||
|| node scripts/generate --tag <tag_name> ||
|| ||
|| ||
|| ||
===========================================================================================================================
////////
== API Reference
This document contains the entire list of the OpenSearch API supported by the client. The client is entirely licensed under Apache 2.0.
OpenSearch 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 OpenSearch, 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
})
// callback 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.
\n\n`
doc += commonParameters(common)
spec.forEach(s => {
doc += '\n' + generateApiDoc(s)
})
return doc
}