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
POST _reindex | |
{ | |
"source": { | |
"index": "apache_elk_example_org" | |
}, | |
"dest": { | |
"index": "apache_elk_example" | |
}, | |
"script": { | |
"inline": "Random rdm = new Random();ctx._source['@timestamp'] = params.dates[rdm.nextInt(params.dates.length)]+ ctx._source['@timestamp'].substring(10);", |
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
String json = "{" + | |
"\"user\":\"kimchy\"\n," + | |
"\"postDate\":\"2013-01-30\"," + | |
"\"message\":\"trying out Elasticsearch\"" + | |
"}"; | |
BulkRequestBuilder bulkRequest = client.prepareBulk(); | |
bulkRequest.add(client.prepareIndex("test1", "tweet", "id1").setSource(json)); |
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
PUT hoge_index | |
{ | |
"settings": { | |
"number_of_shards": 1, | |
"number_of_replicas": 0 | |
}, | |
"mappings": { | |
"hoge": { | |
"properties": { |
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
DELETE /filtered_aggs | |
PUT /filtered_aggs | |
PUT /filtered_aggs/example/1 | |
{ | |
"text" : "this is test doc" | |
} | |
PUT /filtered_aggs/example/2 |
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
DELETE kuromoji_sample | |
PUT kuromoji_sample | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"hoge" : { | |
"type" : "custom", | |
"tokenizer" : "kuromoji_tokenizer", |
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
GET sensu-metrics-2014.10.31/_search | |
{ | |
"facets": { | |
"0": { | |
"date_histogram": { | |
"key_field": "@timestamp", | |
"value_field": "value", | |
"interval": "1m" | |
}, | |
"global": true, |
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 -XPUT localhost:9200/test_idx -d @config.json | |
{"error":"MapperParsingException[mapping [test_type]]; nested: IllegalArgumentException[Invalid format: [not_analyze]: Illegal pattern component: n]; nested: IllegalArgumentException[Illegal pattern component: n]; ","status":400}jupiter:ess_env |
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
DELETE /line_aggs | |
# create index and mapping | |
PUT /line_aggs | |
{ | |
"settings": { | |
"number_of_shards": 2, | |
"number_of_replicas": 0 | |
}, | |
"mappings": { |
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
# delete index | |
DELETE /pref_aggs | |
# create index | |
PUT /pref_aggs | |
{ | |
"settings": { | |
"number_of_shards": 2 | |
}, | |
"mappings": { |
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
DELETE /bookstore | |
PUT /bookstore | |
POST /bookstore/books/_mapping | |
{ | |
"books" : { | |
"properties": { | |
"book" : { | |
"type": "nested", |