ElasticSearchã®è¯ã使ãcurlã³ãã³ãã¾ã¨ã
ElasticSearchã®è¯ã使ãcurlã³ãã³ããã¾ã¨ãã¾ãããè¯ãã£ãã使ã£ã¦ãã ããã
ã³ãã³ãã®è©³ç´°ãªèª¬æã¯æ¸ãã¦ãã¾ãããããã¼ã¯ã¼ãã§èª¿ã¹ãã°ããåãããã¨æãã¾ãã
ãã¼ã¿æå ¥ç³»
ã¹ãã¼ãã®ç»é²
curl -XPOST http://localhost:9200/testindex -d @mapper.json
ã¹ãã¼ãã®è¿½å
curl -XPUT 'http://localhost:9200/testindex/_mapping/test' -d ' { "properties" : { "huga" : { "type" : "long" }, "hoge" : { "type" : "string" } } }'
ã¹ãã¼ãã®ç¢ºèª
http://localhost:9200/testindex/_mapping?pretty
ãã¼ã¿ã®ç»é²
curl -XPOST http://localhost:9200/_bulk --data-binary @data.json >/dev/null
ãã¼ã¿åé¤ç³»
ã¤ã³ããã¯ã¹ãã¨åé¤
curl -XDELETE 'http://localhost:9200/testindex'
ãã¼ã¿ã ãåé¤(DELETE *çãª)
curl -XDELETE 'http://localhost:9200/testindex/test/_query' -d '{ "query" : { "match_all" : { } } }'
ç¹å®æ¡ä»¶ãã¼ã¿ã ãåé¤
curl -XDELETE 'http://localhost:9200/testindex/test/_query' -d '{ "query" : { "term" : {"hoge" : 1} } }'
ã¤ã³ããã¯ã¹ã®è¨å®å¤æ´ç³»
ã¨ã¤ãªã¢ã¹ãè¨å®
curl -XPOST 'http://localhost:9200/_aliases' -d ' { "actions" : [ {"add": {"index": "test_index", "alias": "test_alias" }} ] }'
ã¬ããªã«ã·ã£ã¼ãã®æ°ãå¤æ´
curl -XPUT http://localhost:9200/testindex/_settings -d ' { "index" : { "number_of_replicas" : 0 } }'
ã½ããã³ãããã®é »åº¦ãå¤æ´
curl -XPUT http://localhost:9200/testindex/_settings -d ' { "index" : { "refresh_interval" : "30s" } }'
Warmerãç»é²
curl -XPUT localhost:9200/testindex/_warmer/warmer_1 -d '{ "query" : { "match_all" : {} }, "aggs" : { "aggs_1" : { "terms" : { "field" : "field" } } } }'
ã¯ã©ã¹ã¿ã¼ã®è¨å®å¤æ´ç³»
ã·ã£ã¼ãã®èªå移åè¨å®ã®å¤æ´
curl -XPUT http://localhost:9200/_cluster/settings -d '{ "persistent": {"cluster.routing.allocation.enable": "none"} }' curl -XPUT http://localhost:9200/_cluster/settings -d '{ "persistent": {"cluster.routing.allocation.enable": "all"} }'
ãã¹ã¿ã¼ãã¼ãã®æ±ºå®ã«å¿ è¦ãªãã¼ãæ°ãå¤æ´
curl -XPUT http://localhost:9200/_cluster/settings -d '{ "persistent": {"discovery.zen.minimum_master_nodes": 4} }'
ã·ã£ã¼ããæåã§ç§»å
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ "commands" : [ { "move" : { "index" : "test", "shard" : 0, "from_node" : "node1", "to_node" : "node2" } } ] }'
Unassignedã«ãªã£ã¦ããã·ã£ã¼ããåé ç½®
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ "commands" : [ { { "allocate" : { "index" : "test", "shard" : 1, "node" : "node3" } } ] }'
以ä¸ã§ããä½ãééãããã¾ãããæãã¦ãã ããã