10
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Elasticsearch Mapping 備忘

Last updated at Posted at 2014-08-29

ElasticsearchのMappingは、RDBでいうIndexみたいなもの。データ型を定義することで、分かち書きや、Kibanaでの表示を制御できる。

mapping作成

@timestampがあると、Kibanaのhistgramとか表示できる。formatはfieldの形式に合わせて変える。

curl -XPUT {elasticsearchのIP}:{elasticsearchのport}/{index} -d '{"mappings":{"{type}":{"properties":{"hoge":{"type":"string"},"@timestamp":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"}}}}}'

mapping確認

curl -XGET {elasticsearchのIP}:{elasticsearchのport}/{index}/{type}/_mapping

※ {elasticsearchのIP}, {elasticsearchのport}, {index}, {type}は環境に合わせて書きかえる。

10
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?