Last active
August 29, 2015 14:07
-
-
Save up1/cf60c49220264a7d14a7 to your computer and use it in GitHub Desktop.
Demo :: Zero downtime on Elasticsearch
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
$curl -XPOST http://localhost:9200/demo/post/1 | |
{ | |
"author": "Somkiat", | |
"title": "My first post" | |
} |
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
$curl -XGET http://localhost:9200/demo/_mapping?pretty | |
{ | |
"demo" : { | |
"mappings" : { | |
"post" : { | |
"properties" : { | |
"author" : { | |
"type" : "string" | |
}, | |
"title" : { | |
"type" : "string" | |
} | |
} | |
} | |
} | |
} | |
} |
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
$curl -XPOST http://localhost:9200/demo/post/2 | |
{ | |
"Author": "Prathan", | |
"Title": "My second post" | |
} |
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
$curl -XGET http://localhost:9200/demo/_mapping?pretty | |
{ | |
"demo" : { | |
"mappings" : { | |
"post" : { | |
"properties" : { | |
"Author" : { | |
"type" : "string" | |
}, | |
"Title" : { | |
"type" : "string" | |
}, | |
"author" : { | |
"type" : "string" | |
}, | |
"title" : { | |
"type" : "string" | |
} | |
} | |
} | |
} | |
} | |
} |
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
$curl -XGET http://localhost:9200/new_demo/ | |
{ | |
"mappings" : { | |
"post" : { | |
"properties" : { | |
"Author" : { | |
"type" : "string" | |
}, | |
"Title" : { | |
"type" : "string" | |
} | |
} | |
} | |
} | |
} |
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
curl -XPOST localhost:9200/_aliases -d | |
{ | |
"actions": [ | |
{ "add": { | |
"alias": "xxxxx", | |
"index": "demo" | |
}} | |
] | |
} |
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
curl -XPOST localhost:9200/_aliases -d | |
{ | |
"actions": [ | |
{ "remove": { | |
"alias": "xxxxx", | |
"index": "demo" | |
}}, | |
{ "add": { | |
"alias": "xxxxx", | |
"index": "new_demo" | |
}} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment