Skip to content

Instantly share code, notes, and snippets.

@antonkorotkov
Created April 10, 2014 21:11
Show Gist options
  • Save antonkorotkov/10423920 to your computer and use it in GitHub Desktop.
Save antonkorotkov/10423920 to your computer and use it in GitHub Desktop.
ES test
<!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