# curl -XPUT localhost:9200/_template/template_1 -d '
{
"template" : "te*",
"settings" : {
    "number_of_shards" : 1,
    "number_of_replicas":2    
},
"mappings" : {
    "type1" : {
        "_source" : { "enabled" : false }
    }
}
}
'
{"acknowledged":true}

# curl -XGET localhost:9200/_template/template_1?pretty
{
  "template_1" : {
    "order" : 0,
    "template" : "te*",
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "number_of_replicas" : "2"
      }
    },
    "mappings" : {
      "type1" : {
        "_source" : {
          "enabled" : false
        }
      }
    },
    "aliases" : { }
  }
}

curl -XDELETE localhost:9200/_template/template_1

# curl -XPUT 'http://localhost:9200/template_test/tweet/1' -d '{
> "user" : "kimchy",
> "post_date" : "2009-11-15T14:12:12",
> "message" : "trying out Elasticsearch"
> }'
{"_index":"template_test","_type":"tweet","_id":"1","_version":1,"result":"created","_shards":{"total":3,"successful":1,"failed":0},"created":true} # curl -XGET 'http://localhost:9200/template_test/tweet/1'
{"_index":"template_test","_type":"tweet","_id":"1","_version":1,"found":true,"_source":{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elasticsearch"
}}

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(待续...)

    动态模板 Dynamic templates allow you to define custom mappings that can be applied to dynamically added ...

  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. Js/使用js来改变图片的url

    1.使用js的方式来改变url地址: $('#a1').attr("src","test1.jpg");这种方式来改变图片的url地址: 而不是采用$('#a1 ...

  2. Oracle使用笔记(三)

    在使用oracle过程中,总会遇到用户锁定,密码失效等问题,对于这些问题,总结了以下经验: 一.用户被锁定原因及解锁 对于用户被锁定,有以下几种原因: 1.密码过期: Oracle数据库的用户密码有效 ...

  3. day04列表

    列表 内容详细 1.列表 公共 独有方法 删除 remove pop clear del区别 强制转换 #表示多个事物 users=["lili","Joe", ...

  4. day01计算机基础

    今日内容 1.计算机初步认识 1.计算机认识 1. 计算机基础 1.1硬件:cpu/内存/硬盘/主板/网卡 1.2操作系统 linux:免费开源 windows mac 1.3解释器/编译器 补充:编 ...

  5. poj 3264 倍增 ST表

    #include<iostream> #include<cmath> using namespace std; ; int a[maxn]; ]; ]; int quick(i ...

  6. 关于C语言实现判断给定一个数,判断其是否是一个质数(素数)。

    Annotation:⒈我们需要明确0,1既不是质数,又不是合数.⒉其次我们需要知道一个质数,质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数.(自然数:自然数用以计量事物的件数或表示事 ...

  7. 【SpringBoot】息队列介绍和SpringBoot2.x整合RockketMQ、ActiveMQ

    ========================13.消息队列介绍和SpringBoot2.x整合RockketMQ.ActiveMQ ======================= 1.JMS介绍和 ...

  8. H3C交换机配置vlan

    一,内存二,硬盘(分区,数据量大小)三,电源线,网络线四,raid(raid0,raid1,raid5)五,装系统(系统版本,分区)六,配置网络 1.创建用户 system-view #进入配置loc ...

  9. 手把手教你实现 Google 拓展插件(转自实验楼)

    一.课程简介 1.1 实验介绍 本课程的实验环境由实验楼提供,Google 浏览器拓展的运行环境为 Google 浏览器.在本实验中,你将了解如何制作一个属于你自己的 Google 拓展插件. 课程实 ...

  10. rtsp简介

    https://wenku.baidu.com/view/b10415dabd64783e08122b9c.html 1      概要 RTSP(Real Time Streaming Protoc ...