运行时候出现ReadTimeoutError,该怎么解决
来源:14-12 scrapy写入数据到elasticsearch中 - 1
晴天浪浪
2018-11-14
from datetime import datetime
from elasticsearch_dsl import DocType, Date, Nested, Boolean, \
analyzer, InnerObjectWrapper, Completion, Keyword, Text, Integer
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=["localhost"])
class ArticleType(DocType):
#伯乐在线文章类型
title = Text(analyzer="ik_max_word")
create_date = Date()
praise_nums = Integer()
fav_nums = Integer()
comment_nums = Integer()
front_image_url = Keyword()
front_image_path = Keyword()
url = Keyword()
url_object_id = Keyword()
tags = Text(analyzer="ik_max_word")
content = Text(analyzer="ik_max_word")
class Meta:
index = "jobbole"
doc_type = "article"
if __name__ == "__main__":
ArticleType.init()
这段代码运行的时候,出现了ReadTimeoutError,该怎么解决。
写回答
1回答
-
晴天浪浪
提问者
2018-11-15
今天早上起来重新运行了一次,就没有这个错误了。。。。。
012018-11-16
相似问题