Created
April 10, 2014 21:11
-
-
Save antonkorotkov/10423920 to your computer and use it in GitHub Desktop.
ES test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Elastic</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script type="text/javascript" src="scripts/elastic.js"></script> | |
<script type="text/javascript" src="scripts/elasticsearch.js"></script> | |
<!--<script type="text/javascript" src="scripts/js-http-client.js"></script>--> | |
<script type="text/javascript"> | |
function init() { | |
var client = new elasticsearch.Client({ | |
host: '91.240.22.17:9200' | |
}); | |
client.search({ | |
index: '', | |
body: ejs.Request() | |
.facet(ejs.TermsFacet('TERMS').field('terms')) | |
}).then(function (resp) { | |
var hits = resp.hits.hits; | |
console.log( hits ); | |
}, function (err) { | |
console.trace(err.message); | |
}); | |
} | |
</script> | |
</head> | |
<body onload="init();"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment