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

es各种报错问题及解决方案20231121

报错一

org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
	Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://localhost:9200], URI [/wzx-test/_search?pre_filter_shard_size=128&typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 400 Bad Request]
Warnings: [Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security., [ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices.]
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: Cannot search on field [name] since it is not indexed.","index_uuid":"ERtTBqoxQziiFS50j6658Q","index":"wzx-test"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"wzx-test","node":"cCxDpWCeSqK2ll3x31-W_g","reason":{"type":"query_shard_exception","reason":"failed to create query: Cannot search on field [name] since it is not indexed.","index_uuid":"ERtTBqoxQziiFS50j6658Q","index":"wzx-test","caused_by":{"type":"illegal_argument_exception","reason":"Cannot search on field [name] since it is not indexed."}}}]},"status":400}at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:283)at org.elasticsearch.client.RestClient.performRequest(RestClient.java:261)at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1514)... 109 common frames omitted

报错原因:我在创建索引和字段的时候,name字段不是索引字段,当用精准查询的时候,就报错如上图所示

解决方案:将name字段设置成true,问题解决

PUT /wzx-test
{"mappings": {"properties": {"car_num": {"type": "keyword","index": false},"name": {"type": "keyword","index": true},"age": {"type": "keyword","index": false}}}
}
http://www.lryc.cn/news/238832.html

相关文章:

  • python数据结构与算法-10_递归
  • 如何设计鞋材出库入账管理系统
  • 一个简单的QT应用示例
  • 南京数字孪生赋能工业制造,加速推进制造业数字化转型
  • Visual Studio Code 从英文界面切换中文
  • 邦芒支招:利用自荐电话求职的七大技巧
  • 埃尔米特插值(hermite 插值) C++
  • mysql优化之explain 以及 索引优化
  • WebSocket --- ws模块源码解析(详解)
  • 一文带你拿下MySQL之增删查改(基础)
  • 2023亿发数字化智能工单,专业管理工单处理全流程,助力企业转型腾飞
  • JavaScript 常用符号
  • GPT-4:论文阅读笔记
  • hm商城微服务远程调用及拆分
  • 设置指定时间之前的时间不可选
  • Java使用Redis来实现分布式锁
  • 移动端表格分页uni-app
  • 全志R128芯片RTOS调试指南
  • 超级实用的程序员接单平台,看完少走几年弯路,强推第一个!
  • 前端字符串方法汇总
  • 12 分布式锁加入看门狗
  • 怎么判断list是否为null
  • 11.数据公式中使用2个 $$ a =b $$,是什么意思?
  • 设计模式-14-迭代器模式
  • 防雷接地+防雷工程施工综合方案
  • 排序算法--选择排序
  • 【Web】Ctfshow SSRF刷题记录1
  • 【算法挨揍日记】day30——300. 最长递增子序列、376. 摆动序列
  • ROS2对比ROS1的一些变化与优势(全新安装ROS2以及编译错误处理)《1》
  • 基于单片机PM2.5监测系统仿真设计