gpt4 book ai didi

solr - 添加字段时出错 'field_name' -'field_value' msg=对于输入字符串 : \"field_Value\"

转载 作者:行者123 更新时间:2023-12-02 02:50:05 24 4
gpt4 key购买 nike

我们有时很难将某些文件导入到 Solr 中。似乎某些文档具有奇怪的元数据(值),不确定它是否来自古怪的文字处理器或其他东西。请参阅此处的两个示例:

Type:        Solarium\Exception\HttpException
Message: Solr HTTP error: OK (400)
{"responseHeader":{"status":400,"QTime":49},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.NumberFormatException"],"msg":"ERROR: [doc=3932487729] Error adding field 'brightness_value'='6.18' msg=For input string: \"6.18\"","code":400}}

还有

Type:        Solarium\Exception\HttpException
Severity: error --> Exception: Solr HTTP error: OK (400)
{"responseHeader":{"status":400,"QTime":72},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.NumberFormatException"],"msg":"ERROR: [doc=16996] Error adding field 'version'='5.3.1' msg=For input string: \"5.3.1\"","code":400}}

我们如何预防这些问题?我们无法控制文档,因此需要在服务器上修复它。

最佳答案

在模式中显式定义字段类型,而不是依赖 Solr 为您创建字段类型 - 包含该字段的第一个文档将使 Solr 猜测该字段的类型,并且如果后面的文档与该字段不匹配相同的预期格式,您会收到这样的错误。

在生产或实际应用程序中使用集合时,始终为集合定义架构 - 无架构模式对于原型(prototype)设计和实验来说确实很简洁,但在实际应用程序中,您希望类型得到良好定义。

关于solr - 添加字段时出错 'field_name' -'field_value' msg=对于输入字符串 : \"field_Value\",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48206075/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com