Added a few examples and a link to the readme, set an ID for the api reference page.

This commit is contained in:
Spencer Alger
2013-12-28 08:49:50 -07:00
parent cb1b4b3bc1
commit 6c2330fd8a
4 changed files with 71 additions and 4 deletions

View File

@ -1,3 +1,4 @@
[[api-reference]]
== API Method Reference
@ -136,6 +137,8 @@ client.cluster.nodeHotThreads([params, [callback]])
Returns information about the hottest threads in the cluster or on a specific node as a String. The information is returned as text, and allows you to understand what are currently the most taxing operations happening in the cluster, for debugging or monitoring purposes.
WARNING: This endpoint returns plain text
The default method is `GET` and the usual <<api-conventions,params and return values>> apply. See http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-hot-threads/[the elasticsearch docs] for more about this method.
.Return 10 hottest threads
@ -143,8 +146,10 @@ The default method is `GET` and the usual <<api-conventions,params and return va
---------
client.cluster.nodeHotThreads({
threads: 10
nodeId: 'mymisbehavingnode',
maxRetries: 10
}, function (error, response) {
// WARNING: response is plain text
console.log(response);
})
---------

View File

@ -48,7 +48,7 @@ client.search({
}).then(function (body) {
var hits = body.hits.hits;
}, function (error) {
// freak out!
console.trace(error.message);
});
-----------------
@ -84,10 +84,9 @@ Now for some examples using the Query DSL.
===== Simple match query
.Find tweets that have "elasticsearch" in their body field
[source,js]
-----------------
// match tweets that have "elasticsearch"
// in their body field
client.search({
index: 'twitter',
type: 'tweets',
@ -98,6 +97,10 @@ client.search({
}
}
}
}).then(function (resp) {
var hits = resp.hits.hits;
}, function (err) {
console.trace(err.message);
});
-----------------