Skip to content

Instantly share code, notes, and snippets.

@quoeamaster
Last active July 3, 2018 07:14
Show Gist options
  • Save quoeamaster/35af1a7292546f2907c7be6c97bb9eb3 to your computer and use it in GitHub Desktop.
Save quoeamaster/35af1a7292546f2907c7be6c97bb9eb3 to your computer and use it in GitHub Desktop.
medium - client-side jquery library for es
// connect to a node (localhost:9200)
var client = new $.es.Client({
hosts: 'localhost:9200'
});
// run a simple query
client.search({
index: 'product_index',
type: 'doc',
body: {
query: {
match: {
'product_desc': 'sports shoes yellow shoe laces'
}
}
}
}, function(error) {
if (error) {
console.log("something wrong " + error);
} else {
console.log("query succeeded");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment