gpt4 book ai didi

java - 我可以用来向 SOLR 提交多条记录的最优化/最短的 JSON 结构是什么

转载 作者:行者123 更新时间:2023-12-02 00:37:00 25 4
gpt4 key购买 nike

这个 JSON 是否合法地向 SOLR 添加文档?

{
"add": [{"doc": {"id" : "TestDoc1", "title" : "test1"} },
{"doc": {"id" : "TestDoc2", "title" : "another test"} },
{"doc": {"id" : "TestDoc1", "title" : "test1"} },
{"doc": {"id" : "TestDoc2", "title" : "another test"}}]
}

我正在使用 SOLR 3.4 并从 PHP 内部使用 CURL 提交。如果这不正确,我应该在日志中看到什么?

编辑:这个问题被错误地理解为好像我在上面的结构中存在错误(我确实缺少括号),但这不是目的。这个问题是一个更普遍的问题,我编辑了标题以反射(reflect)这一点。

最佳答案

您在末尾缺少一个},不是吗?

{
"add": [{"doc": {"id" : "TestDoc1", "title" : "test1"} },
{"doc": {"id" : "TestDoc2", "title" : "another test"} },
{"doc": {"id" : "TestDoc1", "title" : "test1"} },
{"doc": {"id" : "TestDoc2", "title" : "another test"} }]
}

关于java - 我可以用来向 SOLR 提交多条记录的最优化/最短的 JSON 结构是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7560552/

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