Elasticsearch template(待续...)
动态模板
Dynamic templates allow you to define custom mappings that can be applied to dynamically added fields based on:
- the datatype detected by Elasticsearch, with
match_mapping_type
. - the name of the field, with
match
andunmatch
ormatch_pattern
. - the full dotted path to the field, with
path_match
andpath_unmatch
.
The original field name {name}
and the detected datatype {dynamic_type
} template variables can be used in the mapping specification as placeholders.
动态模板允许你基于以下条件来对动态增加的字段的映射进行自定义:
1. match_mapping_type 定义 ES 自动检测的数据类型
2. match、unmatch 或 match_pattern 匹配字段名称
3. path_match、path_unmatch 定义字段的全路径
参数说明
template
settings
注意事项
dynamic_templates 类型为数组,多个匹配条件要写为数据的不同元素
示例
为所有索引 (index) 的所有类型 (type) 的所有字符串类型字段(field)都设置为 not_analyzed。
curl -XPUT 'localhost:9200/_template/all' -d '
{
"order": 0,
"template": "*",
"settings": {
"index.number_of_shards": ""
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"string": {
"mapping": {
"index": "not_analyzed",
"type": "string"
},
"match_mapping_type": "string",
"match": "field_name*"
}
}
]
}
},
"aliases": {}
}
}
'
Elasticsearch template(待续...)的更多相关文章
- Elasticsearch template学习
Elasticsearch template Elasticsearch存在一个关键问题就是索引的设置及字段的属性指定,最常见的问题就是,某个字段我们并不希望ES对其进行分词,但如果使用自动模板创建索 ...
- Elasticsearch template configuration
Index templates allow defining templates thatwill automatically be applied to new indices created. T ...
- elasticsearch template
# curl -XPUT localhost:9200/_template/template_1 -d '{"template" : "te*","s ...
- lagstash + elasticsearch + kibana 3 + kafka 日志管理系统部署 02
因公司数据安全和分析的需要,故调研了一下 GlusterFS + lagstash + elasticsearch + kibana 3 + redis 整合在一起的日志管理应用: 安装,配置过程,使 ...
- ElasticSearch实战:Linux日志对接Kibana
本文由云+社区发表 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTFul web接口.ElasticSearch是用Java开发 ...
- Elasticsearch - 简单介绍
Elasticsearch 简介 1. 什么是 Elasticsearch ElasticSearch 是一个基于 Lucene 的搜索服务器. 它了一个分布式多 用户能力的全文搜索引擎,能够达到实时 ...
- Elasticsearch学习之配置小记
基于 elasticsearch 1.4.4 版本.安装方式为RPM安装.所有涉及路径需根据实际情况来设置判断. 0x01 内存调整 调整ES内存分配有多种方式,建议调整 /etc/sysconfig ...
- elasticsearch+logstash+redis+kibana 实时分析nginx日志
1. 部署环境 2. 架构拓扑 3. nginx安装 安装在192.168.176.128服务器上 这里安装就简单粗暴了直接yum安装nginx [root@manager ~]# yum -y in ...
- elasticsearch配置小记(转)
原文 http://bigbo.github.io/pages/2015/04/10/elasticsearch_config/ 基于 elasticsearch 1.4.4 版本.安装方式为RPM ...
随机推荐
- warden 的设计与实现 总结
--------------------------------------------------------参考资料---------------------------------------- ...
- 一个HR给应届毕业生的面试建议 后悔看到的太晚了 (转)
开始之前务必记住: 黄金法则:80/20---你要承担起80%的谈话而面试官只会说20%. 白金法则:你必须试着控制面试的节奏和话题. 钻石法则:对于没有把握的问题,抛回给面试 ...
- CSS换行:word-wrap、word-break和text-wrap区别
一.word-wrap:允许对长的不可分割的单词进行分割并换行到下一行.(中英文处理效果一样) word-wrap有两个取值: 1.word-wrap: normal:只在允许的断字点换行(浏览器保持 ...
- bzoj 2154 Crash的数字表格(莫比乌斯反演及优化)
Description 今天的数学课上,Crash小朋友学习了最小公倍数(Least Common Multiple).对于两个正整数a和b,LCM(a, b)表示能同时被a和b整除的最小正整数.例如 ...
- 分享两个模拟get和post方法的工具类,让应用能够与服务器进行数据交互
很久没有码字了,今天跟大家分享一个模拟get和post方法的工具类,在安卓应用中很多都需要跟服务器进行数据交互,这需要两方面的配合,首先服务器端会给应用提供一些数据交互的接口,可是怎样在应用中去调用呢 ...
- POJ 3254 poj3254 Corn Fields
题意:给出一个n行m列的草地,1表示肥沃,0表示贫瘠,现在要把一些牛放在肥沃的草地上,但是要求所有牛不能相邻,问你有多少种放法. 思路: DP[i][j]=sum(dp[i-1][k]); i表示当前 ...
- uva 12296 Pieces and Discs
题意: 有个矩形,左下角(0,0),左上角(L,W). 思路: 除了圆盘之外,本题的输入也是个PSLG,因此可以按照前面叙述的算法求出各个区域:只需把线段视为直线,用切割凸多边形的方法 :每次读入线段 ...
- MVC 部署出现错误未能写入输出文件xxxxxxx.
编译器错误消息: CS0016: 未能写入输出文件“c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ro ...
- Google的IP地址一览表,加上代理服务器
Bulgaria 93.123.23.1 93.123.23.2 93.123.23.3 93.123.23.4 93.123.23.5 93.123.23.6 93.123.23.7 93.123. ...
- A Tour of Go Function values
Functions are values too. 在函数式语言中中函数都是变量,比如在javascript中 package main import ( "fmt" " ...