You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download one of these browser-ready builds, or install them with `bower`
35
35
36
+
NOTE: The entire API is compatible with IE 10+, Chrome, Firefox, Safari, and Opera. **IE 8 & 9** only support GET and POST requests cross-domain which is how the `'XhrConnection'` class makes it's requests.
- Returns jQuery deferred objects (Adds an abort() method)
57
+
58
+
```
59
+
bower install elasticsearch-jquery
52
60
```
53
61
54
62
## Configuration
@@ -95,12 +103,9 @@ Default:
95
103
- Node: `'http'`
96
104
- Browser: `'xhr'`
97
105
- Angular Build: `'angular'`
106
+
- jQuery Build: `'jquery'`
98
107
99
-
Options:
100
-
- Node: `'http'`
101
-
- Browser: based on bundle, `'xhr'`, `'angular'`, and `'jquery'` are currently available
102
-
103
-
Defines the class that will be created once for each node/host that the client communicates with. If you are looking to implement a special protocol you will probably start by writing a Connection class and specifying it here.
108
+
Defines the class that will be created once for each node/host that the client communicates with. If you are looking to implement a protocol besides HTTP you will probably start by writing a Connection class and specifying it here.
104
109
105
110
### selector
106
111
Type: `String`, `Function`
@@ -111,23 +116,23 @@ Options:
111
116
- `'roundRobin'`
112
117
- `'random'`
113
118
114
-
Defined a function that 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 prefering connections in a certain rack, or datacenter.
119
+
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.
115
120
116
-
To make this function asynchronous, accept a second argument which will be the callback which should be called as a Nodestyle callback with a possible error: `cb(err, selectedConnection)`.
121
+
To make this function asynchronous, accept a second argument which will be the callback to use. The callback should be called Node-style, a possible error like `cb(err, selectedConnection)`.
117
122
118
123
### sniffOnStart
119
124
Type: `Boolean`
120
125
121
126
Default: `false`
122
127
123
-
Should the client attempt to detect the rest of the cluster when it is first instanciated?
128
+
Should the client attempt to detect the rest of the cluster when it is first instantiated?
124
129
125
130
### sniffAfterRequests
126
131
Type: `Number` or `false`
127
132
128
133
Default: `false`
129
134
130
-
After `n` requests, perform a sniff operation and ensure out list of nodes is up to date
135
+
After `n` requests, perform a sniff operation and ensure out list of nodes is up to date.
131
136
132
137
133
138
### sniffOnConnectionFail
@@ -149,7 +154,7 @@ Type: `Number`
149
154
150
155
Default: 10000
151
156
152
-
How many milliseconds can the connection take before the request is aboorted and retried. (TODO: timeout errors shouldn't cause a retry).
157
+
How many milliseconds can the connection take before the request is aborted and retried. (TODO: timeout errors shouldn't cause a retry).
153
158
154
159
### deadTimeout
155
160
Type: `Number`
@@ -170,7 +175,7 @@ Type: `Function`
170
175
171
176
Default: simple, not much going on [here](src/lib/client_config.js#L65).
172
177
173
-
This function will receive a list of nodes received durring a sniff. The list of nodes should be transformed into an array of objects which will be fed to the [Host](src/lib/host.js) class. (TODO: allow this function to be async).
178
+
This function will receive a list of nodes received during a sniff. The list of nodes should be transformed into an array of objects which will be fed to the [Host](src/lib/host.js) class. (TODO: allow this function to be async).
0 commit comments