pysolr.solrerror:solr响应错误(http 409):[原因:预期的版本冲突=实际=]

r8xiu3jd  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(460)

我正在尝试使用solr搜索检索文档,然后尝试将具有相同id的相同文档添加回solr。在执行此操作时,我会遇到版本冲突。基本上我是在补充 url 链接,如下面的代码所示。

  1. solr = pysolr.Solr('http://****', timeout=10)
  2. results = solr.search('resourceType:abc', rows=10)
  3. for res in results:
  4. if 'url' not in res:
  5. print("adding...........")
  6. print(res['id'])
  7. link = 'https://twitter.com/twitter/statuses/' + res['id']
  8. res['url'] = link
  9. solr.add(res)
  10. print(link)
  11. else:
  12. print("no need to add")

输出:

  1. pysolr.SolrError: Solr responded with an error (HTTP 409): [Reason: version conflict for 1402196942545952769 expected=1703466479926640640 actual=1703528530413879296]

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题