# 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. $inject

    function breadcrumb($parse, store) { } // 为了压缩 breadcrumb.$inject = ['$parse', 'breadcrumbStore']

  2. 测试那些事儿—SQL Server服务器角色和数据库用户角色

    登录名:登录服务器的用户账号: 服务器角色:登录名对该服务器具有的权限,角色分多种的,一个角色可以有多个登录名,如操作系统的系统用户可以有多个. SQL服务器角色  sysadmin         ...

  3. input[type='file']默认样式

    <input type="file" name="" id="" value="" /> 当input的ty ...

  4. PythonStudy——Python 内存池机制 (Memory pool mechanism) Pymalloc

    Python是如何进行内存管理-内存池机制 Pymalloc Python引用了一个内存池(memory pool)机制,即Pymalloc机制(malloc:n.分配内存),用于对小块内存的申请和释 ...

  5. php输出数据到csv文件

    function export() { $fileName = date('Y-m-d').uniqid().'.csv'; set_time_limit(0); ini_set('memory_li ...

  6. 将文件夹下的所有csv文件存入数据库

    # 股票的多因子分层回测代码实现 import os import pymysql # import datetime, time # from config import * database_ta ...

  7. FP-Growth算法

    FP-Growth算法的目标是发现模式,其特点就是高效,因为可以通过设置发生频次直接过滤掉一些低频次的元素:而且秉承了和Apriori的思想,对于低频次的元素,其父级和子级的组合都是低频的. FP-G ...

  8. httpd基础知识

    apache简介   Apache取自"a patchy server"的读音,意思是充满补丁的服务器.Apache起初由伊利诺伊大学香槟分校的国家超级电脑应用中心(NCSA)开发 ...

  9. xshell 显示中文

    xshell 可能无法正常显示中文,即使选择了utf-8编码也不生效. 1:输入:echo $LANG 显示:en_US.UTF-8 2.输入:export LANG=zh_CN.UTF-8 3. 输 ...

  10. marathon 测试

    marathon 初步使用 关闭selinux setenforce 0 Marathon之应用篇 先来了解一下  Marathon 是怎么布署decker的 json shell.json { } ...