Elasticsearch索引模板-转载
转载地址:https://dongbo0737.github.io/2017/06/13/elasticsearch-template/#similar_posts
Elasticsearch索引模板
使用Elasticsearch 存储数据的时候,每个单独的索引,或者一个类型的索引都可能有些自己特殊的属性,这样我们就要使用template了 通过指定指定的模版名字,来定义这个类型的索引多少个分片和副本,哪些字段不需要分词等等 使用*可以模糊匹配索引.
例如: business-* 可以匹配到 business-2017.05.01
business template
{
"order": 0,
"template": "test-business-*",
"settings": {
"index": {
"routing": {
"allocation": {
"require": {
"box_type": "hot"
}
}
},
"refresh_interval": "3s",
"analysis": {
"filter": {
"camel_filter": {
"split_on_numerics": "false",
"type": "word_delimiter",
"stem_english_possessive": "false",
"generate_number_parts": "false",
"protected_words": [
"iPhone",
"WiFi"
]
}
},
"analyzer": {
"camel_analyzer": {
"filter": [
"camel_filter",
"lowercase"
],
"char_filter": [
"html_strip"
],
"type": "custom",
"tokenizer": "ik_smart"
}
},
"tokenizer": {
"my_tokenizer": {
"type": "whitespace",
"enable_lowercase": "false"
}
}
},
"number_of_shards": "30",
"number_of_replicas": "0"
}
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"message_field": {
"mapping": {
"analyzer": "camel_analyzer",
"index": "analyzed",
"omit_norms": true,
"type": "string"
},
"match_mapping_type": "string",
"match": "message"
}
},
{
"logid_field": {
"mapping": {
"type": "long"
},
"match_mapping_type": "string",
"match": "logid"
}
},
{
"string_fields": {
"mapping": {
"index": "not_analyzed",
"omit_norms": true,
"type": "string",
"fields": {
"raw": {
"ignore_above": 256,
"index": "not_analyzed",
"type": "string"
}
}
},
"match_mapping_type": "string",
"match": "*"
}
}
],
"_all": {
"omit_norms": true,
"enabled": true
},
"properties": {
"geoip": {
"dynamic": true,
"type": "object",
"properties": {
"location": {
"type": "geo_point"
}
}
},
"@version": {
"index": "not_analyzed",
"type": "string"
}
}
}
},
"aliases": {}
}
webaccess template
{
"order": 0,
"template": "test-webaccess-*",
"settings": {
"index": {
"routing": {
"allocation": {
"require": {
"box_type": "hot"
}
}
},
"refresh_interval": "3s",
"analysis": {
"analyzer": {
"ik": {
"type": "custom",
"tokenizer": "ik_smart"
}
}
},
"number_of_shards": "20",
"number_of_replicas": "0"
}
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"message_field": {
"mapping": {
"analyzer": "ik",
"index": "analyzed",
"omit_norms": true,
"type": "string"
},
"match_mapping_type": "string",
"match": "message"
}
},
{
"bytes_field": {
"mapping": {
"type": "long"
},
"match_mapping_type": "string",
"match": "bytes"
}
},
{
"string_fields": {
"mapping": {
"index": "not_analyzed",
"omit_norms": true,
"type": "string",
"fields": {
"raw": {
"ignore_above": 256,
"index": "not_analyzed",
"type": "string"
}
}
},
"match_mapping_type": "string",
"match": "*"
}
}
],
"_all": {
"omit_norms": true,
"enabled": true
},
"properties": {
"geoip": {
"dynamic": true,
"type": "object",
"properties": {
"location": {
"type": "geo_point"
}
}
},
"@version": {
"index": "not_analyzed",
"type": "string"
}
}
}
},
"aliases": {}
}
Similar Posts
Elasticsearch索引模板-转载的更多相关文章
- ElasticStack学习(八):ElasticSearch索引模板与聚合分析初探
一.Index Template与Dynamic Template的概念 1.Index Template:它是用来根据提前设定的Mappings和Settings,并按照一定的规则,自动匹配到新创建 ...
- Elasticsearch索引模板和别名
创建模板(模板名和索引名一样都不能有大写) PUT http://222.108.x.x:9200/_template/templateds { "template": " ...
- ES 10 - Elasticsearch的索引别名和索引模板
目录 1 索引模板概述 1.1 什么是索引模板 1.2 索引模板中的内容 1.3 索引模板的用途 2 创建索引模板 3 查看索引模板 4 删除索引模板 5 模板的使用建议 5.1 一个index中不能 ...
- Elasticsearch之索引模板index template与索引别名index alias
为什么需要索引模板? 在实际工作中针对一批大量数据存储的时候需要使用多个索引库,如果手工指定每个索引库的配置信息(settings和mappings)的话就很麻烦了. 所以,这个时候,就存在创建索引模 ...
- elasticsearch 5.x 系列之四(索引模板的使用,详细得不要不要的)
1,首先看一下下面这个索引模板 curl -XPUT "master:9200/_template/template_1?pretty" -H 'Content-Type: app ...
- ElasticSearch(六):索引模板
ElasticSearch(六):索引模板 学习课程链接<Elasticsearch核心技术与实战> Index Template Index Template - 帮助你设定Mappin ...
- Elasticsearch学习笔记——索引模板
在索引模板里面,date类型的字段的format支持多种类型,在es中全部会转换成long类型进行存储,参考 https://zhuanlan.zhihu.com/p/34240906 一个索引模板范 ...
- Elasticsearch入门教程(三):Elasticsearch索引&映射
原文:Elasticsearch入门教程(三):Elasticsearch索引&映射 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文 ...
- Elasticsearch7.X 入门学习第八课笔记-----索引模板和动态模板
原文:Elasticsearch7.X 入门学习第八课笔记-----索引模板和动态模板 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接: ...
随机推荐
- onsen & UI & vue & mobile UI
onsen & UI vue & mobile UI $ npm i onsenui vue-onsenui # OR $ npm i -S onsenui vue-onsenui h ...
- js 位掩码
原文 定义掩码 const mask0 = parseInt("00000001", 2); const mask1 = parseInt("00000010" ...
- 双十一NGK官方快讯!
- 如何在数据库中进行RBAC权限应用
上周我们发了一篇关于"删库跑路"引发了大家对于数据安全的思考,而权限管理又跟数据安全密不可分.权限管理作为数据系统的重要组成部分,通过控制账号的可支配能力,防止因用户操作不当导致的 ...
- K8S部署Redis Cluster集群(三主三从模式) - 部署笔记
一.Redis 介绍 Redis代表REmote DIctionary Server是一种开源的内存中数据存储,通常用作数据库,缓存或消息代理.它可以存储和操作高级数据类型,例如列表,地图,集合和排序 ...
- pytorch中修改后的模型如何加载预训练模型
问题描述 简单来说,比如你要加载一个vgg16模型,但是你自己需要的网络结构并不是原本的vgg16网络,可能你删掉某些层,可能你改掉某些层,这时你去加载预训练模型,就会报错,错误原因就是你的模型和原本 ...
- vue路由理解
vue路由:就是一个菜单的概念比如说有一个菜单栏,菜单栏上有很多按钮,当你点击一个按钮时会出现不同的页面,这就是vue路由
- Python学习相关链接
感觉挺全的: http://www.cnblogs.com/xinshiye/p/9015187.html 也挺全的:http://www.cnblogs.com/toutou/category/72 ...
- Vue学习笔记-rest_framework_jwt 学习
一 使用环境 开发系统: windows 后端IDE: PyCharm 前端IDE: VSCode 数据库: msyql,navicat 编程语言: python3.7 (Windows x86- ...
- SpringBoot2.x中的AOP机制总结(附带demo)
寄语:刚开始学aop的时候是大三吧,老师讲的不好,我也没学好,导致现在才有个较为清晰的认知,那个时候只知道有aop, 根部不明白aop的作用,时至今日,任然觉得aop难以咀嚼,奈何平时不用面试要用,特 ...