gpt4 book ai didi

solr - 将文件发布到 solr 时出现未知命令错误

转载 作者:行者123 更新时间:2023-12-01 08:05:55 25 4
gpt4 key购买 nike

我正在尝试将文件的以下 json 格式发布到 solr
{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him. I've found his office to be fairly efficient. Today I actually got to see the doctor a few minutes early! \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative. \n\nI'm glad to have Dr. Goldberg as my doctor."}
但是我得到了错误
Response: {"responseHeader":{"status":400,"QTime":32}," error":{"msg":"Unknown command 'user_name' at [12]","code":400}}
在我尝试做的时候
post.sh -c coreName fileName.json
这真让我抓狂。我已卸载核心并再次创建它,以查看先前尝试发布文件是否导致此错误。但这并没有帮助。

最佳答案

当您发送一个对象时,Solr 正在寻找一个命令(如“添加”),因此您需要添加该命令,如下所示:

{"add": {"doc":{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him.  I've found his office to be fairly efficient.  Today I actually got to see the doctor a few minutes early!  \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative.    \n\nI'm glad to have Dr. Goldberg as my doctor."}}}

或者把它放在一个数组中:
[{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him.  I've found his office to be fairly efficient.  Today I actually got to see the doctor a few minutes early!  \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative.    \n\nI'm glad to have Dr. Goldberg as my doctor."}]

另见: https://wiki.apache.org/solr/UpdateJSON

关于solr - 将文件发布到 solr 时出现未知命令错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34173753/

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