【问题标题】:error: [Errno 10060] A connection attempt failed when using solrpy in python错误:[Errno 10060] 在 python 中使用 solrpy 时连接尝试失败
【发布时间】:2015-04-09 02:09:14
【问题描述】:

当我尝试运行以下使用 solrpy 的 python 代码时,

enter code here

import solr

s = solr.SolrConnection('http://example.org:8080/solr')
s.add(id=1, title='Lucene in Action', author=['hello','lucky'])
s.commit()
response = s.query('title:lucene')
for hit in response.results:
    print hit['title']

我收到以下错误:

error: [Errno 10060] 连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应

【问题讨论】:

标签: python-2.7 solr


【解决方案1】:

您应该指向一个有效的 Solr(您确定在 example.org 上有一个 Solr 在运行吗?)

【讨论】:

    猜你喜欢
    • 2016-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-26
    • 1970-01-01
    相关资源
    最近更新 更多