Skip to content

Commit 027956b

Browse files
nik9000spalger
authored andcommitted
Make legacy docs asciidoctor compatible (#793)
* Make legacy docs asciidoctor compatible This modifies the legacy client documentation so that it is is compatible with Asciidoctor. With these changes asciidoctor renders the same way as asciidoc, module spacing and a couple of auto-generated ids. I'm willing to ignore the auto-generated anchors because these are legacy docs. * Updated configuration template (cherry picked from commit d699045)
1 parent 110d5f4 commit 027956b

File tree

3 files changed

+57
-57
lines changed

3 files changed

+57
-57
lines changed

docs/api_param_types.asciidoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
The <<api-reference>> describes the type that each parameter accepts, this reference describes each of those types in more a little more detail.
55

66
[horizontal]
7-
`Boolean`[[api-param-type-boolean]]:: -- `true` or `false`.
7+
[[api-param-type-boolean]]`Boolean`:: -- `true` or `false`.
88

9-
`Number`[[api-param-type-number]]:: -- A basic JavaScript number.
9+
[[api-param-type-number]]`Number`:: -- A basic JavaScript number.
1010

11-
`String`[[api-param-type-string]]:: -- A basic JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String[String].
11+
[[api-param-type-string]]`String`:: -- A basic JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String[String].
1212

13-
`String[]`[[api-param-type-string-array]]:: -- An array of strings.
13+
[[api-param-type-string-array]]`String[]`:: -- An array of strings.
1414

15-
`Object`[[api-param-type-object]]:: -- A JSON serializable object.
15+
[[api-param-type-object]]`Object`:: -- A JSON serializable object.
1616

17-
`Object[]`[[api-param-type-object-array]]:: -- An array of JSON serializable objects.
17+
[[api-param-type-object-array]]`Object[]`:: -- An array of JSON serializable objects.
1818

19-
`JSON`[[api-param-type-json]]:: -- A string or `Buffer` containing a serialized JSON object.
19+
[[api-param-type-json]]`JSON`:: -- A string or `Buffer` containing a serialized JSON object.
2020

21-
`JSONLines`[[api-param-type-json-lines]]:: -- A string or `Buffer` of new-line (`\n`) delimited JSON objects.
21+
[[api-param-type-json-lines]]`JSONLines`:: -- A string or `Buffer` of new-line (`\n`) delimited JSON objects.
2222

23-
`DurationString`[[api-param-type-duration-string]]:: -- A string that represents a duration of time with a number followed by an https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#time-units[elasticsearch time unit]. `30m` is thirty minutes, `2d` is two days, and so on.
23+
[[api-param-type-duration-string]]`DurationString`:: -- A string that represents a duration of time with a number followed by an https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#time-units[elasticsearch time unit]. `30m` is thirty minutes, `2d` is two days, and so on.

docs/configuration.asciidoc

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WARNING: Due to the complex nature of the configuration, the config object you p
1616
[[config-options]]
1717
=== Config options
1818
[horizontal]
19-
`host or hosts`[[config-hosts]]::
19+
[[config-hosts]]`host or hosts`::
2020
`String, String[], Object[]` -- Specify the hosts that this client will connect to. If sniffing is enabled, or you call `client.sniff()`, this list will be used as seeds to discover the rest of your cluster.
2121
+
2222
The value(s) are passed to the <<host-reference,`Host`>> constructor. `Host` objects can help enforce path-prefixes, default headers and query strings, and can be helpful in making more intelligent selection algorithms; Head over to <<host-reference,the `Host` docs>> for more information.
@@ -29,7 +29,7 @@ Default:::
2929
------
3030

3131

32-
`httpAuth`[[config-http-auth]]:: `String` -- Specifies the default http auth as a String with username and password separated by a colon (eg. `user:pass`). Applies to any host defined in the original config, and any hosts discovered while sniffing.
32+
[[config-http-auth]]`httpAuth`:: `String` -- Specifies the default http auth as a String with username and password separated by a colon (eg. `user:pass`). Applies to any host defined in the original config, and any hosts discovered while sniffing.
3333

3434

3535
`log`[[config-log]]:: `String, String[], Object, Object[], Constructor` -- Unless a constructor is specified, this sets the output settings for the bundled logger. See the section on configuring-logging[logging] for more information.
@@ -48,7 +48,7 @@ Default in Node:::
4848

4949

5050

51-
`apiVersion`[[config-api-version]]:: `String` -- Change the API that they client provides, specify the major version of the Elasticsearch nodes you will be connecting to.
51+
[[config-api-version]]`apiVersion`:: `String` -- Change the API that they client provides, specify the major version of the Elasticsearch nodes you will be connecting to.
5252
+
5353
WARNING: This default will track the latest version of Elasticsearch, and is only intended to be used during development. It is highly recommended that you set this parameter in all code that is headed to production.
5454

@@ -74,7 +74,7 @@ Options in the browser :::
7474

7575

7676

77-
`plugins`[[config-plugins]]:: `Function[]` -- Plugin instantiators that will be called when the Client initializes. Each function is called in order with the arguments `Constructor`, `config`, and `components`.
77+
[[config-plugins]]`plugins`:: `Function[]` -- Plugin instantiators that will be called when the Client initializes. Each function is called in order with the arguments `Constructor`, `config`, and `components`.
7878
+
7979
`Constructor` is the class that will be newed up to create the client instance. It's prototype contains the api methods that correlate to the `apiVersion` requested.
8080
+
@@ -83,86 +83,86 @@ Options in the browser :::
8383
`components` is a map of the internal classes for this version of the elasticsearch client. The values on this object are listed https://github.com/elastic/elasticsearch-js/blob/master/src/lib/client.js#L80[here].
8484

8585

86-
`sniffOnStart`[[config-sniff-on-start]]:: `Boolean` -- Should the client attempt to detect the rest of the cluster when it is first instantiated?
86+
[[config-sniff-on-start]]`sniffOnStart`:: `Boolean` -- Should the client attempt to detect the rest of the cluster when it is first instantiated?
8787

8888
Default::: `false`
8989

9090

9191

9292

9393

94-
`sniffInterval`[[config-sniff-interval]]:: `Number, false` -- Every `n` milliseconds, perform a sniff operation and make sure our list of nodes is complete.
94+
[[config-sniff-interval]]`sniffInterval`:: `Number, false` -- Every `n` milliseconds, perform a sniff operation and make sure our list of nodes is complete.
9595

9696
Default::: `false`
9797

9898

9999

100100

101101

102-
`sniffOnConnectionFault`[[config-sniff-on-connection-fault]]:: `Boolean` -- Should the client immediately sniff for a more current list of nodes when a connection dies?
102+
[[config-sniff-on-connection-fault]]`sniffOnConnectionFault`:: `Boolean` -- Should the client immediately sniff for a more current list of nodes when a connection dies?
103103

104104
Default::: `false`
105105

106106

107107

108108

109-
`maxRetries`[[config-max-retries]]:: `Integer` -- How many times should the client try to connect to other nodes before returning a <<connection-fault,ConnectionFault>> error.
109+
[[config-max-retries]]`maxRetries`:: `Integer` -- How many times should the client try to connect to other nodes before returning a <<connection-fault,ConnectionFault>> error.
110110

111111
Default::: `3`
112112

113113

114114

115115

116116

117-
`requestTimeout`[[config-request-timeout]]:: `Number` -- Milliseconds before an HTTP request will be aborted and retried. This can also be set per request.
117+
[[config-request-timeout]]`requestTimeout`:: `Number` -- Milliseconds before an HTTP request will be aborted and retried. This can also be set per request.
118118

119119
Default::: `30000`
120120

121121

122122

123123

124124

125-
`deadTimeout`[[config-dead-timeout]]:: `Number` -- Milliseconds that a dead connection will wait before attempting to revive itself.
125+
[[config-dead-timeout]]`deadTimeout`:: `Number` -- Milliseconds that a dead connection will wait before attempting to revive itself.
126126

127127
Default::: `60000`
128128

129129

130-
`pingTimeout`[[config-ping-timeout]]:: `Number` -- Milliseconds that a ping request can take before timing out.
130+
[[config-ping-timeout]]`pingTimeout`:: `Number` -- Milliseconds that a ping request can take before timing out.
131131

132132
Default::: `3000`
133133

134134

135-
`maxSockets`[[config-keep-alive-max-sockets]]:: `Number` -- Maximum number of sockets to allow per host.
135+
[[config-keep-alive-max-sockets]]`maxSockets`:: `Number` -- Maximum number of sockets to allow per host.
136136

137137
Default::: `Infinity`
138138

139139

140-
`keepAlive`[[config-keep-alive]]:: `Boolean` -- Should the connections to the node be kept open forever? This behavior is recommended when you are connecting directly to Elasticsearch.
140+
[[config-keep-alive]]`keepAlive`:: `Boolean` -- Should the connections to the node be kept open forever? This behavior is recommended when you are connecting directly to Elasticsearch.
141141

142142
Default::: `true`
143143

144144

145-
`keepAliveInterval`[[config-keep-alive-interval]]:: `Number` -- How often, in milliseconds, should TCP KeepAlive packets be sent over sockets being kept alive. Only relevant if `keepAlive` is set to `true`.
145+
[[config-keep-alive-interval]]`keepAliveInterval`:: `Number` -- How often, in milliseconds, should TCP KeepAlive packets be sent over sockets being kept alive. Only relevant if `keepAlive` is set to `true`.
146146

147147
Default::: `1000`
148148

149149

150-
`keepAliveMaxFreeSockets`[[config-keep-alive-max-free-sockets]]:: `Number` -- Maximum number of inactive sockets to keep connected to a node. Only relevant if `keepAlive` is set to `true`.
150+
[[config-keep-alive-max-free-sockets]]`keepAliveMaxFreeSockets`:: `Number` -- Maximum number of inactive sockets to keep connected to a node. Only relevant if `keepAlive` is set to `true`.
151151

152152
Default::: `256`
153153

154154

155-
`keepAliveFreeSocketTimeout`[[config-keep-alive-free-socket-timeout]]:: `Number` -- Sets inactive sockets to timeout after milliseconds of inactivity. Only relevant if `keepAlive` is set to `true`.
155+
[[config-keep-alive-free-socket-timeout]]`keepAliveFreeSocketTimeout`:: `Number` -- Sets inactive sockets to timeout after milliseconds of inactivity. Only relevant if `keepAlive` is set to `true`.
156156

157157
Default::: `60000`
158158

159159

160-
`suggestCompression`[[config-suggest-compression]]:: `Boolean` -- The client should inform Elasticsearch, on each request, that it can accept compressed responses. In order for the responses to actually be compressed, you must enable `http.compression` in Elasticsearch. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html[these docs] for additional info.
160+
[[config-suggest-compression]]`suggestCompression`:: `Boolean` -- The client should inform Elasticsearch, on each request, that it can accept compressed responses. In order for the responses to actually be compressed, you must enable `http.compression` in Elasticsearch. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html[these docs] for additional info.
161161

162162
Default::: `false`
163163

164164

165-
`connectionClass`[[config-connection-class]]:: `String, Constructor` -- Defines the class that will be used to create connections to store in the connection pool. If you are looking to implement additional protocols you should probably start by writing a Connection class that extends the ConnectionAbstract.
165+
[[config-connection-class]]`connectionClass`:: `String, Constructor` -- Defines the class that will be used to create connections to store in the connection pool. If you are looking to implement additional protocols you should probably start by writing a Connection class that extends the ConnectionAbstract.
166166

167167
Defaults:::
168168
* Node: `"http"`
@@ -171,12 +171,12 @@ Defaults:::
171171
* jQuery Build: `"jquery"`
172172

173173

174-
`sniffedNodesProtocol`[[config-sniffed-nodes-protocol]]:: `String` -- Defines the protocol that will be used to communicate with nodes discovered during sniffing.
174+
[[config-sniffed-nodes-protocol]]`sniffedNodesProtocol`:: `String` -- Defines the protocol that will be used to communicate with nodes discovered during sniffing.
175175

176176
Default::: If all of the hosts/host passed to the client via configuration use the same protocol then this defaults to that protocol, otherwise it defaults to `"http"`.
177177

178178

179-
`ssl`[[config-ssl]]:: `Object` -- An object defining HTTPS/SSL configuration to use for all nodes. The properties of this mimic the options accepted by http://nodejs.org/docs/latest/api/tls.html#tls_tls_connect_port_host_options_callback[`tls.connect()`] with the exception of `rejectUnauthorized`, which defaults to `false` allowing self-signed certificates to work out-of-the-box.
179+
[[config-ssl]]`ssl`:: `Object` -- An object defining HTTPS/SSL configuration to use for all nodes. The properties of this mimic the options accepted by http://nodejs.org/docs/latest/api/tls.html#tls_tls_connect_port_host_options_callback[`tls.connect()`] with the exception of `rejectUnauthorized`, which defaults to `false` allowing self-signed certificates to work out-of-the-box.
180180
+
181181
Additional information available in <<auth-reference>>.
182182

@@ -206,7 +206,7 @@ var client = new elasticsearch.Client({
206206
-----
207207

208208

209-
`selector`[[config-selector]]:: `String, Function` -- This function will be used to select a connection from the ConnectionPool. It should received a single argument, the list of "active" connections, and return the connection to use. Use this selector to implement special logic for your client such as preferring nodes in a certain rack or data-center.
209+
[[config-selector]]`selector`:: `String, Function` -- This function will be used to select a connection from the ConnectionPool. It should received a single argument, the list of "active" connections, and return the connection to use. Use this selector to implement special logic for your client such as preferring nodes in a certain rack or data-center.
210210
+
211211
To make this function asynchronous, accept a second argument which will be the callback to use. The callback should be called Node-style with a possible error like: `cb(err, selectedConnection)`.
212212

@@ -220,7 +220,7 @@ Options:::
220220

221221

222222

223-
`defer`[[config-defer]]:: `Function` -- Override the way that the client creates promises. If you would rather use any other promise library this is how you'd do that. Elasticsearch.js expects that the defer object has a `promise` property (which will be returned to promise consumers), as well as `resolve` and `reject` methods.
223+
[[config-defer]]`defer`:: `Function` -- Override the way that the client creates promises. If you would rather use any other promise library this is how you'd do that. Elasticsearch.js expects that the defer object has a `promise` property (which will be returned to promise consumers), as well as `resolve` and `reject` methods.
224224

225225
Default::: Defer object created with ES6 Promise
226226

@@ -238,15 +238,15 @@ var client = new elasticsearch.Client({
238238

239239

240240

241-
`nodesToHostCallback`[[config-nodes-to-host-callback]]:: `Function` - This function will receive the list of nodes returned from the `_cluster/nodes` API during a sniff operation. The function should return an array of objects which match the <<config-hosts,specification for the `hosts` config>>.
241+
[[config-nodes-to-host-callback]]`nodesToHostCallback`:: `Function` - This function will receive the list of nodes returned from the `_cluster/nodes` API during a sniff operation. The function should return an array of objects which match the <<config-hosts,specification for the `hosts` config>>.
242242

243243
Default:::
244244
see https://github.com/elasticsearch/elasticsearch-js/blob/master/src/lib/nodes_to_host.js[nodes_to_host.js]
245245

246246

247247

248248

249-
`createNodeAgent`[[config-create-node-agent]]:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration.
249+
[[config-create-node-agent]]`createNodeAgent`:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration.
250250
+
251251
The function is called with two arguments, first an `HttpConnector`[http://github.com/spalger/elasticsearch-js/blob/master/src/lib/connectors/http.js] object and the second the config object initially passed when creating the client.
252252

0 commit comments

Comments
 (0)