当前位置: 首页 > news >正文

郑州做商城网站西安最新招聘信息

郑州做商城网站,西安最新招聘信息,顺电网上商城app,附近室内装修公司电话原文网址#xff1a;ES之API系列--index template(索引模板)的用法(有实例)_IT利刃出鞘的博客-CSDN博客 简介 说明 本文介绍ElasticSearch的index template(索引模板)的用法(有实例)。 官网网址 https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index-temp…原文网址ES之API系列--index template(索引模板)的用法(有实例)_IT利刃出鞘的博客-CSDN博客 简介 说明 本文介绍ElasticSearch的index template(索引模板)的用法(有实例)。 官网网址 https://www.elastic.co/guide/en/elasticsearch/reference/8.0/index-templates.html 索引模板的作用 作用概述 在新建索引时如果索引名字与索引模板的通配符匹配那么就使用索引模板的设置_setting、_mapping等。 模板仅在索引创建时才会生效而且修改模板不会影响现有的索引。可以指定priority的数值如果新建的索引匹配到了多个模板则使用priority最高的那个priority值最小。 7.8之前的版本是order字段。会对匹配到的多个模板进行合并如果一个字段在多个模板中则取order比较小优先级高的那个。 应用场景 为将来的动态映射的索引进行限制 例如有多个系统写入日志索引每天生成一个新索引采用动态映射的方式。原先系统的时间是yyyy-MM-dd HH:mm:ss创建索引后动态映射的日期格式为“format:strict_date_optional_time||epoch_millis||yyyy-MM-dd HH:mm:ss”新系统以yyyy-MM-dd HH:mm:ss.SSS格式写进去时会报错。解决方案直接将该日期字段改为format: strict_date_optional_time||epoch_millis||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS。创建索引时会支持新格式。为创建索引提供便利 例如可以在模板设置好number_of_shardsnumber_of_replicas创建索引时就自动使用模板的配置不需要再设置了。 版本的区别 7.8之后的命令是_index_template 7.8之前的命令是_template 用法完全一样。本文介绍7.8及之后的命令。 创建与更新索引模板 创建和更新的命令是一样的。如果不存在则创建如果存在则更新。 简洁方法(_index_template) PUT _index_template/template1 {index_patterns: [te*, bar*],template: {settings: {number_of_shards: 1},mappings: {_source: {enabled: false},properties: {host_name: {type: keyword},created_at: {type: date,format: yyyy-MM-dd HH:mm:ss.SSS}}},aliases: {mydata: { }}},priority: 10,version: 3,_meta: {description: my custom} } 上边这个模板设置了index_patterns 为 te* 和bar*意思就是te或bar开头的索引在创建时都会使用这个模板。 复杂方法(_index_template_component_template) PUT _component_template/component_template1 {template: {mappings: {properties: {timestamp: {type: date}}}} }PUT _component_template/other_component_template {template: {mappings: {properties: {ip_address: {type: ip}}}} }PUT _index_template/template_1 {index_patterns: [te*, bar*],template: {settings: {number_of_shards: 1},mappings: {_source: {enabled: false},properties: {host_name: {type: keyword},created_at: {type: date,format: yyyy-MM-dd HH:mm:ss.SSS}}},aliases: {mydata: { }}},priority: 10,composed_of: [component_template1, other_component_template],version: 3,_meta: {description: my custom} }index_template 创建时如果它包含的 component_template与component_template 或 component_template与index_template 中properties存在重复的属性则index_template创建会报错。 查看索引模板 查看所有索引模板 GET _index_template 示例  查看单个索引模板 GET _index_template/template_name 示例 查看多个索引模板通配符 GET _index_template/template_pattern 示例 查看组件模板 GET _component_template/component_template_name 删除索引模板 删除索引模板 DELETE _index_template/template_name 删除组件模板 DELETE _component_template/component_template_name 日期检测与数字检测 概述 如果某个字段没有设置映射那么在新建文档时会自动根据字段来生成映射比如日期和数字。 示例 如果日期字段符合“yyyy-MM-dd HH:mm:ss.SSS格式就自动将该字段的type设置为date类型并且format会包含“yyyy-MM-dd HH:mm:ss.SSS”这种格式。如果字段是个数字则自动将该字段的type设置为Long之类的类型。 配置方法 默认这种类型检测是开启的配置方法如下 PUT _index_template/template_name {index_patterns: [test*],priority: 1,settings: {number_of_shards: 1,number_of_replicas: 2},mappings: {date_detection: false,numeric_detection: true} }
http://www.dnsts.com.cn/news/43527.html

相关文章:

  • 正能量不良网站直接进入app开发工具简单
  • 罗田网站建设wordpress cms 制作
  • 给网站添加代码南京中如建设公司
  • 企业网站网上推广的途径合肥专门做网站
  • 我们做网站 出教材 办育心经app开发团队公司
  • 福州做网站的公司多少钱网站素材包括哪些
  • 网站索引怎么做电子商务 网站建设
  • 昆山市建设局网站6网站添加flash
  • 如何建设网站济南兴田德润o团队怎么样小程序设计软件
  • 网站的基本价格wordpress模板文件命名
  • 从零开始网站建设学校网站织梦源码
  • 淮北专业网站建设wordpress 共享
  • 商丘网站建设推广渠道手机百度网址是什么
  • 河南睢县筑宇建设网站新沂市网站建设
  • 网站建设前言和背景盐城做网站价格
  • 云南网站建设快速优化金华市建设技工学校教育培训网站
  • 深圳网站制作的公司商丘河南网站建设
  • 做贵网站多少钱长沙优化网站技术厂家
  • 国家网站后缀吉林公路建设有限公司网站
  • 网站扫码登录怎么做湘潭手机网站
  • 广州专业的网站推广工具深圳英文站seo
  • 网站建设合同属于购销吗百度域名地址
  • 国内做网站公司哪家好网站建设前台后台设计
  • 手机网站做多少钱给工厂做英文外贸网站
  • 容桂网站智能推广新闻做土特产网站什么名字最好
  • 微信做购物网站怎么抽佣国内外包平台
  • 汽车业务网站开发公司孝感做网站xgsh
  • 南宁建设银行缴费网站室内家装设计
  • 做app 的模板下载网站seo技术培训东莞
  • 包头焦点网站建设重庆免费网站推广软件