Comparing version 0.0.3 to 0.0.4
@@ -66,2 +66,3 @@ var fs = require('fs'); | ||
"</script>" + | ||
'<a href="https://github.com/saltukalakus/etk"><img style="position: fixed; top: 0; left: 0; border: 0; z-index: 999999" src="https://camo.githubusercontent.com/121cd7cbdc3e4855075ea8b558508b91ac463ac2/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png"></a>' + | ||
"</body>\n</html>" | ||
@@ -80,3 +81,3 @@ )) | ||
.pipe(replace("</body>\n</html>", | ||
"<style> .type-signature { font-size:50px;} .page-title {display: none;}</style>" + | ||
"<style> .type-signature { font-size:60px;} .signature {color: orange;} .page-title {display: none;}</style>" + | ||
"<script type='text/javascript' src='scripts/jquery-watch-element.js'></script>" + | ||
@@ -88,2 +89,3 @@ "<script>$( document ).ready(function(){$('.toc-h1').waitUntilExists(" + | ||
"</script>" + | ||
'<a href="https://github.com/saltukalakus/etk"><img style="position: fixed; top: 0; left: 0; border: 0; z-index: 999999" src="https://camo.githubusercontent.com/121cd7cbdc3e4855075ea8b558508b91ac463ac2/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png"></a>' + | ||
"</body>\n</html>")) | ||
@@ -90,0 +92,0 @@ .pipe(replace("Global", "API")) |
10
index.js
Esq = require('esq'); | ||
Module.exports = Etk; | ||
module.exports = Etk; | ||
@@ -25,7 +25,7 @@ function Etk(client, opt) { | ||
search: function (key, value, cb) { | ||
var search_text = key + ":" + value; | ||
var esq = new Esq(); | ||
esq.query("query", "filtered", "query", "match", key, value); | ||
var query = esq.getQuery(); | ||
this.client.search({ | ||
index: this.index, | ||
type: this.type, | ||
body: search_text}, | ||
body: query}, | ||
cb); | ||
@@ -32,0 +32,0 @@ }, |
{ | ||
"name": "etk", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Elastic search tool kit.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -10,2 +10,5 @@ ## ElasticSearch Tool Kit | ||
## API Documentation | ||
[Site-Link](http://saltukalakus.github.io/etk) | ||
## License | ||
@@ -17,1 +20,2 @@ | ||
[travis-url]: https://travis-ci.org/saltukalakus/etk | ||
var test = require('tape'); | ||
var elastic = require('elasticsearch'); | ||
//var etk = require('../index'); | ||
var etk = require('../index'); | ||
var client = elastic.Client({ | ||
hosts: [ | ||
'localhost:9200' | ||
] | ||
}); | ||
//var client = etk(elastic, {index: "myindex", "type": "mytype"}); | ||
var client_1 = new etk(client, {index: "myindex2", type: "mytype"}); | ||
var client_2 = new etk(client, {index: "myin3dex2", type: "myty3pe2"}); | ||
client_1.tk.searchLastDays("foo", 1, 20, function (err, resp) { | ||
console.log("1"); | ||
console.log(JSON.stringify(resp)); | ||
}); | ||
client_1.tk.search("foo", 1, function (err, resp) { | ||
console.log("2"); | ||
console.log(JSON.stringify(resp)); | ||
}); | ||
client_2.tk.searchLastDays("foo", 1, 20, function (err, resp) { | ||
console.log("3"); | ||
console.log(JSON.stringify(resp)); | ||
}); | ||
client_2.tk.search("foo", 1, function (err, resp) { | ||
console.log("4"); | ||
console.log(JSON.stringify(resp)); | ||
}); | ||
client_1.tk.search("foo", 1, function (err, resp) { | ||
console.log("5"); | ||
console.log(JSON.stringify(resp)); | ||
}); | ||
//client_tk.tk.create({"a":1}, function(){console.log("hello")}); | ||
test("Populate the data set", function(t) { | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3140027
122657
20