动态模板

Dynamic templates allow you to define custom mappings that can be applied to dynamically added fields based on:

The original field name {name} and the detected datatype {dynamic_typetemplate 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(待续...)的更多相关文章

  1. Elasticsearch template学习

    Elasticsearch template Elasticsearch存在一个关键问题就是索引的设置及字段的属性指定,最常见的问题就是,某个字段我们并不希望ES对其进行分词,但如果使用自动模板创建索 ...

  2. Elasticsearch template configuration

    Index templates allow defining templates thatwill automatically be applied to new indices created. T ...

  3. elasticsearch template

    # curl -XPUT localhost:9200/_template/template_1 -d '{"template" : "te*","s ...

  4. lagstash + elasticsearch + kibana 3 + kafka 日志管理系统部署 02

    因公司数据安全和分析的需要,故调研了一下 GlusterFS + lagstash + elasticsearch + kibana 3 + redis 整合在一起的日志管理应用: 安装,配置过程,使 ...

  5. ElasticSearch实战:Linux日志对接Kibana

    本文由云+社区发表 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTFul web接口.ElasticSearch是用Java开发 ...

  6. Elasticsearch - 简单介绍

    Elasticsearch 简介 1. 什么是 Elasticsearch ElasticSearch 是一个基于 Lucene 的搜索服务器. 它了一个分布式多 用户能力的全文搜索引擎,能够达到实时 ...

  7. Elasticsearch学习之配置小记

    基于 elasticsearch 1.4.4 版本.安装方式为RPM安装.所有涉及路径需根据实际情况来设置判断. 0x01 内存调整 调整ES内存分配有多种方式,建议调整 /etc/sysconfig ...

  8. elasticsearch+logstash+redis+kibana 实时分析nginx日志

    1. 部署环境 2. 架构拓扑 3. nginx安装 安装在192.168.176.128服务器上 这里安装就简单粗暴了直接yum安装nginx [root@manager ~]# yum -y in ...

  9. elasticsearch配置小记(转)

    原文  http://bigbo.github.io/pages/2015/04/10/elasticsearch_config/ 基于 elasticsearch 1.4.4 版本.安装方式为RPM ...

随机推荐

  1. [GRYZ2015]阿Q的停车场

    题目描述 刚拿到驾照的KJ 总喜欢开着车到处兜风,玩完了再把车停到阿Q的停车场里,虽然她对自己停车的水平很有信心,但她还是不放心其他人的停车水平,尤其是Kelukin.于是,她每次都把自己的爱车停在距 ...

  2. 深度学习多机多卡解决方案-purine

    未经允许请不要转载,原作者:zhxfl,http://www.cnblogs.com/zhxfl/p/5287644.html 目录: 一.简介 二.环境配置 三.运行demo 四.硬件配置建议 五. ...

  3. 单点登录与消息队列以及在J2EE中的实现方案

    前言 这次为大家简单介绍两个在WEB开发中经常使用的概念——单点登录和消息队列以及具体到J2EE中的一些实现方案.本文原创性的工作比较少,主要是一些总结概括和自己的理解. 单点登录SSO SSO的业务 ...

  4. HDU 1226 BFS

    注意密码位数<=500 输出注意十六进制改成字母 要点题目都已说明 ac就好 #include<iostream> #include<stdio.h> #include& ...

  5. sts中从svn导入maven项目

    1.创建资源库 2.导入项目作为本地项目 3.将子module从本地导入(默认情况下,只会将主pom所在的工程导入)

  6. Python Django manage.py提供的命令及用法

    λpython manage.pyType'manage.py help <subcommand>'for help on a specific subcommand. Available ...

  7. java方法签名

    方法的名字和参数列表称为方法的签名.方法的返回类型不是方法签名的一部分.

  8. 【STL源码学习】STL算法学习之四

    排序算法是STL算法中相当常用的一个类别,包括部分排序和全部排序算法,依据效率和应用场景进行选择. 明细: sort 函数原型: template <class RandomAccessIter ...

  9. c# 泛型List的定义、作用、用法

    定义:List<T>类表示可通过索引访问的对象的强类型列表,提供用于对列表进行搜索.排序和操作的方法. 作用: 泛型最常见的用途是泛型集合 我们在创建列表类时,列表项的数据类型可能是int ...

  10. NSTimer运行机制和线程问题

    A.首先要理解NSTimer运行机制和Runloop之间的关系: 1.IOS的Run Loops机制 Run Loops是线程的基础部份,任何线程,包括主结程,都包含了一个run loop对象,Coc ...