new Etk(client, opt)
Parameters:
Name |
Type |
Argument |
Description |
client |
object
|
|
elasticsearch instance |
opt |
json
|
<optional>
|
Configuration options for Etk instance.
index {string} Index which Etk operates on. Default is search all
type: {string} Type which Etk operated on. Default is search all
raw_response: {bool} Returns elasticsearch response object without any modification. Default is false.
raw_error: {bool} Returns elasticsearch error object without any modification. Default is false. |
Example
elastic = require('elasticsearch');
Etk = require('etk');
var client = elastic.Client({hosts: ['localhost:9200']});
var tk = new Etk(client, {index: "myindex", type: "mytype"});
tk.search("foo", "bar", function (err, resp) {
...
});