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

Solr7.4.0报错org.apache.solr.common.SolrException

文章目录

  • org.apache.solr.common.SolrException: Exception writing document id MATERIAL-99598435990497269125316 to the index; possible analysis error: cannot change DocValues type from NUMERIC to SORTED_NUMERIC for field "opt_time"
  • Exception writing document id MATERIAL-43619171460367415133741 to the index; possible analysis error: cannot change DocValues type from NUMERIC to SORTED_NUMERIC for field "opt_time"

org.apache.solr.common.SolrException: Exception writing document id MATERIAL-99598435990497269125316 to the index; possible analysis error: cannot change DocValues type from NUMERIC to SORTED_NUMERIC for field “opt_time”

查看当前字段定义:

curl http://localhost:8983/solr/your_core/schema/fields/opt_time

请将 your_core 替换为你的Solr核心名称

删除旧字段定义:

curl -X DELETE http://localhost:8983/solr/your_core/schema/fields/opt_time

可以使用 web 页面删除
在这里插入图片描述

重新定义字段:

curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name": "opt_time","type": "pdate","indexed": true,"stored": true,"docValues": true,"multiValued": false}
}' http://localhost:8983/solr/your_core/schema

Exception writing document id MATERIAL-43619171460367415133741 to the index; possible analysis error: cannot change DocValues type from NUMERIC to SORTED_NUMERIC for field “opt_time”

这个错误信息表明在使用 SolrJ 客户端向 Solr 服务器发送文档时遇到了问题。具体错误是尝试将字段 “opt_time” 的 DocValues 类型从 NUMERIC 更改为 SORTED_NUMERIC,这在 Solr 中是不允许的。

首先,你需要检查 Solr 的 managed-schema 或 schema.xml 文件中字段 “opt_time” 的定义。如果你使用的是 managed-schema,你可以通过 Solr 的管理界面或使用 Schema API 来查看字段定义。

更新字段定义

如果 “opt_time” 字段的 DocValues 类型确实需要是 SORTED_NUMERIC,而当前设置为 NUMERIC,你需要更新字段定义。这可以通过 Schema API 来完成。例如,你可以发送一个 POST 请求来更新字段定义:

curl -X POST -H 'Content-type:application/json' --data-binary '{"update-field": {"name": "opt_time","type": "pdate","indexed": true,"stored": true,"docValues": "SORTED_NUMERIC","multiValued": false}
}' http://localhost:8983/solr/your_core/schema

这里使用的是 update-field如果不行,可以删除掉out_time,使用 add-field来添加

curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field": {"name": "opt_time","type": "pdate","indexed": true,"stored": true,"docValues": "SORTED_NUMERIC","multiValued": false}
}' http://admin:Oi2a@172.111.111.182:8983/solr/2-testcore/schema
http://www.lryc.cn/news/377675.html

相关文章:

  • 从2-3-4树开始理解红黑二叉树(JAVA代码手撸版)
  • 模板类与继承
  • 随手记:uniapp图片展示,剩余的堆叠
  • 微服务迁移、重构最佳经验
  • 【Python】从0开始的Django基础
  • 红黑树(数据结构篇)
  • 高级视频编码器性能对比(H265、VP9、AV1)
  • 示例:WPF中DataGrid简单设置合并列头
  • Matlab图像处理——细胞图像的分割和计数显示
  • 六爻排盘神机
  • 【ARMv8/v9 GIC 系列 2.1 -- GIC SPI 中断的 pending 和 clear pending 配置】
  • SpringBoot集成logback初始化源码解析(部分)
  • 【Linux工具】yum软件包管理器与Vim编辑器的高效运用
  • Matlab数学建模实战应用:案例4 - 图像处理
  • Studying-代码随想录训练营day15| 222.完全二叉树的节点个数、110.平衡二叉树、257.二叉树的所有路径、404.左叶子之和
  • Python 基础:异常
  • XML 应用程序
  • SprringCloud Gateway动态添加路由不重启
  • Windows安装mysql
  • chatgpt: linux 下用纯c 编写ui
  • Java十六进制Dump打印数据
  • 某棋牌渗透测试
  • JAVA面试(六)
  • 【C语言】手写学生管理系统丨附源码+教程
  • 流媒体传输协议HTTP-FLV、WebSocket-FLV、HTTP-TS 和 WebSocket-TS的详细介绍、应用场景及对比
  • 【机器学习】线性回归:从基础到实践的深度解析
  • 短视频开源项目MoneyPrinterTurbo:AI副业搞起来,视频制作更轻松!
  • 【JAVA】SpringBoot + skywalking 将接口的入参、出参、异常等信息上报到skywalking 链路追踪服务器上
  • [xmake]构建静态库和动态库
  • 功能测试 之 单模块测试----轮播图、登录、注册