Elasticsearch 6 创建索引报错 invalid_index_name_exception Invalid index name [testDemo], must be lowercase

news/2024/7/7 5:49:10 标签: elasticsearch, es, 索引

Elasticsearch 6 创建索引报错:

Invalid index name [testDemo], must be lowercase

原因:Elasticsearch 6 默认索引类型是_doc,如果想改变则要指定索引类型

示例:

PUT testDemo
{
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "location": {
        "type": "geo_point"
      }
    }
   }
}

返回:

{
  "error": {
    "root_cause": [
      {
        "type": "invalid_index_name_exception",
        "reason": "Invalid index name [testDemo], must be lowercase",
        "index_uuid": "_na_",
        "index": "testDemo"
      }
    ],
    "type": "invalid_index_name_exception",
    "reason": "Invalid index name [testDemo], must be lowercase",
    "index_uuid": "_na_",
    "index": "testDemo"
  },
  "status": 400
}

指定索引类型:

PUT testDemo
{
  "mappings": {
    "product": {
    "properties": {
      "name": {
        "type": "text"
      },
      "location": {
        "type": "geo_point"
      }
    }
   }
  }
}

结果:

{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "testDemo"
}

product为指定索引类型


http://www.niftyadmin.cn/n/1101019.html

相关文章

mysql order by查询速度问题_使用ORDER BY时查询速度慢

这是查询(最大的表约有40,000行)SELECTCourse.CourseID,Course.Description,UserCourse.UserID,UserCourse.TimeAllowed,UserCourse.CreatedOn,UserCourse.PassedOn,UserCourse.IssuedOn,C.LessonCntFROMUserCourseINNER JOINCourseUSING(CourseID)INNER JOIN(SELECT CourseID,…

Comparator.comparing排序报空指针异常

最近由于系统调整,导致部分系统名出现null值,隐藏的bug被触发: list.sort(Comparator.comparing(System::getSystemChName)) 当含有系统名称为null数据时,会报空指针异常,可以使用: Comparator.nullsLas…

python 中cookie_Python中Cookie的处理(二)cookielib库

Python中cookielib库(python3中为http.cookiejar)为存储和管理cookie提供客户端支持。该模块主要功能是提供可存储cookie的对象。使用此模块捕获cookie并在后续连接请求时重新发送,还可以用来处理包含cookie数据的文件。这个模块主要提供了这几个对象,Co…

使用JAVA8 filter对List多条件模糊筛选、单个参数多个值过滤、多个参数联合排序

对于从缓存中获取的list集合如果根据条件进行模糊查询呢&#xff1f; 条件根据indexName字段筛选需要的值 1、造数据 List<ShardsInfoDto> shardsList new ArrayList<>();ShardsInfoDto shardsInfoDto new ShardsInfoDto();shardsInfoDto.setIndexName("…

mysql 安装 se_MySQL-安装数据库(Linux)

1. 安装前环境配置1)关闭防火墙-- service版本service iptables stopchkconfig off iptables-- systemctl版本systemctl stop firewalld.servicesystemctl disable firewalld.service2)关闭selinux# 禁用selinux&#xff0c;配置/etc/sysconfig/selinux&#xff0c;修改SELINUX…

python实现qq登录界面_Python实现QQ界面

Python实现QQ界面(好友列表&#xff0c;通信部分还未做好&#xff0c;没时间~~嘻嘻)项目环境&#xff1a;(1)OS:Linux RedHat6.3(2)Language:Python(3)Lib&#xff1a;pygtk,gtk(4)Support tools&#xff1a;Galde3项目简述&#xff1a;(1)实现基本界面(2)使用gtk treeview dou…

.net中调用com的具体操作(总结)

获得某个com实例的接口地址&#xff08;知道此实例的具体接口&#xff09; IntPtr ppv Marshal.GetComInterfaceForObject( this.m_view, typeof(HelperItems.IShellView) ); 获得某个com实例的接口地址&#xff08;不知道此实例的具体接口&#xff09; IntPtr iunkMe Marsh…

vs怎么创建python项目_怎么在vs创建python

打开VS2017&#xff0c;在VS2017软件主界面中&#xff0c;点击菜单栏上的文件。选择“新建-项目”。选择红色框“Python”,进而选择Python应用程序&#xff0c;其次在选储存路径。当Python应用程序项目创建之后&#xff0c;VS2017会自动打开模板中自动创建的PythonApplication1…