gpt4 book ai didi

ElasticSearch - 无法解析要映射的内容 - 意外字符 ('\"'

转载 作者:行者123 更新时间:2023-12-04 03:34:13 29 4
gpt4 key购买 nike

想知道您是否可以提供帮助,我在 Elasticsearch 中遇到了我的代码出现错误的问题。我的代码在下面,输出也在下面,非常感谢任何帮助。

curl -X PUT "localhost:9200/_mapping/jdbc" -H 'Content-Type: application/x-ndjson' -d '
{
"mappings": {
"jdbc" : {
"properties" : {
"mac_client" : {
"type" : "string",
"index": "not_analyzed"
}
"mac_sniffer" : {
"type" : "string"
"index": "not_analyzed"
}
"rssi" : {
"type" : "long"
}
"timestamp" : {
"type" : "date"
"format" : "strict_date_optional_time||epoch_millis"
}
}
}
}
}
'

我遇到的错误

    {"error":{"root_cause":[{"type":"parse_exception","reason":"Failed to parse content to map"}],"type":"parse_exception","reason":"Failed to parse content to map","caused_by":{"type":"json_parse_exception","reason":"Unexpected character ('\"' (code 34)): was expecting comma to separate OBJECT entries\n at [Source: org.elasticsearch.common.compress.deflate.DeflateCompressor$1@66d3b7cb; line: 10, column: 12]"}},"status":400}

最佳答案

您的 json 无效,您可以使用类似 https://jsonformatter.curiousconcept.com/ 的内容将来检查。

以下内容应该是有效的 - 格式正确的 json 总是有助于查看错误

{
"mappings": {
"jdbc": {
"properties": {
"mac_client": {
"type": "string",
"index": "not_analyzed"
},
"mac_sniffer": {
"type": "string",
"index": "not_analyzed"
},
"rssi": {
"type": "long"
},
"timestamp": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}
}

关于ElasticSearch - 无法解析要映射的内容 - 意外字符 ('\"',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54336974/

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