Skip to content

Instantly share code, notes, and snippets.

@deploytoprod
Created November 9, 2017 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deploytoprod/fff663b0e40ed85f77bbffe9d65c809d to your computer and use it in GitHub Desktop.
Save deploytoprod/fff663b0e40ed85f77bbffe9d65c809d to your computer and use it in GitHub Desktop.
Elasticsearch info:
Elasticsearch Domain Name: es-domain
Number of nodes: 2
Disk space per node: 20 GB
Cluster type: Public but closed to my IP address
My IP address: 216.40.74.186
Domain name: es-domain
Cluster Endpoint: search-es-domain-dsbyregycjpium6ks4prehgjwy.us-west-2.es.amazonaws.com
Command to index data:
curl -X PUT 'https://search-es-domain-dsbyregycjpium6ks4prehgjwy.us-west-2.es.amazonaws.com/movies/movie/1' -d '
{
"director": "Burton, Tim",
"genre": ["Comedy","Sci-Fi"],
"year": 1996,
"actor": ["Jack Nicholson","Pierce Brosnan","Sarah Jessica Parker"],
"title": "Mars Attacks!"
}' |jq .
Command to get document #1:
curl -X GET 'https://search-es-domain-dsbyregycjpium6ks4prehgjwy.us-west-2.es.amazonaws.com/movies/movie/1' |jq .
Command to get documents with "1996" in "year":
curl -X GET 'https://search-es-domain-dsbyregycjpium6ks4prehgjwy.us-west-2.es.amazonaws.com/movies/_search?q=year:1996&pretty=true' |jq .
Command to delete document #1:
curl -X DELETE 'https://search-es-domain-dsbyregycjpium6ks4prehgjwy.us-west-2.es.amazonaws.com/movies/movie/1' |jq .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment