关系型DB与ES元数据区别
Relational DB -> Databases -> Tables -> Rows -> Columns
Elasticsearch -> Indices -> Types -> Documents -> Fields
模板
动态模板参数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| { "index_patterns": ["index_name_pattern*"], "order": 0, "version": 1001, "settings": { ... }, "aliases":{ "alias1" : {}, "alias2" : { "filter" : { "term" : {"user" : "kimchy" } }, "routing" : "kimchy" }, "{index}-alias" : {} }, "mappings": { "type": { "_source": { "enabled": false }, "dynamic_date_formats":[ "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" ], "dynamic_templates": [{ "time_field": { "mapping":{ "type":"date" }, "match":"*Time" }, ... }], "properties": { "host_name": { "type": "keyword" }, ... } } } }
|
动态模板2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| PUT _template/fruits_template { "index_patterns": ["shop*", "bar*"], "order": 0, "settings": { "number_of_shards": 1 }, "aliases": { "alias_1": {} }, "mappings": { "_doc": { "_source": { "enabled": false }, "properties": { "@timestamp": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss" }, "@version": { "doc_values": true, "index": "false", "type": "text" }, "logLevel": { "type": "long" } } } } }
|
模板参数官方文档:
https://www.elastic.co/guide/en/elasticsearch/reference/7.1/index-modules.html
多表关联模板设计