Last active
July 3, 2018 07:14
-
-
Save quoeamaster/35af1a7292546f2907c7be6c97bb9eb3 to your computer and use it in GitHub Desktop.
medium - client-side jquery library for es
This file contains 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
// 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