如何使用 json 在 solr 更新中一次插入多个索引
How to insert multiple index at a time on a solr update using json
我参考了不同的相关网页,了解如何在单个请求中 post 对 solr 进行多个索引。我已经完成了 solr link http://wiki.apache.org/solr/UpdateJSON#Example 但是 link 解释功能不是很清楚。
我还发现像这样创建 json:
{
"add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
"add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}
可以解决问题。但在这种情况下,只有最后一个索引是 updated/inserted 索引。我的项目是一个 java 项目。请帮我解决这个问题。
JSON 模块支持使用常规 JSON 数组表示法(从 3.2 开始)。如果您要添加文档,则也不需要 "add" 键:
[
{
"id" : "MyTestDocument",
"title" : "This is just a test"
},
{
"id" : "MyTestDocument2",
"title" : "This is antoher test"
}
]
我参考了不同的相关网页,了解如何在单个请求中 post 对 solr 进行多个索引。我已经完成了 solr link http://wiki.apache.org/solr/UpdateJSON#Example 但是 link 解释功能不是很清楚。
我还发现像这样创建 json:
{
"add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
"add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}
可以解决问题。但在这种情况下,只有最后一个索引是 updated/inserted 索引。我的项目是一个 java 项目。请帮我解决这个问题。
JSON 模块支持使用常规 JSON 数组表示法(从 3.2 开始)。如果您要添加文档,则也不需要 "add" 键:
[
{
"id" : "MyTestDocument",
"title" : "This is just a test"
},
{
"id" : "MyTestDocument2",
"title" : "This is antoher test"
}
]