elasticsearch-dsl 版本6.3.1 其中, elasticsearch 6.5.4 kibana 6.5.4,但是报错
来源:14-12 scrapy写入数据到elasticsearch中 - 1
慕后端2376581
2019-01-10
-- coding: utf-8 --
author = “bobby”
from datetime import datetime
from elasticsearch_dsl import Document, Date, Nested, Boolean, analyzer, InnerDoc, Completion, Keyword, Text, Integer
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=[“localhost”])
class ArticleType(Document):
#伯乐在线文章类型
title = Text(analyzer=“ik_max_word”)
create_date = Date()
url = Keyword()
url_object_id = Keyword()
front_image_url = Keyword()
front_image_path = Keyword()
praise_nums = Integer()
comment_nums = Integer()
fav_nums = Integer()
tags = Text(analyzer=“ik_max_word”)
content = Text(analyzer=“ik_max_word”)
class Meta:
index = "jobbole"
doc_type = "article"
if name == “main”:
ArticleType.init()
报错:
Traceback (most recent call last):
File “C:/Users/admin/PycharmProjects/ArticleSpider/ArticleSpider/models/es_types.py”, line 32, in
ArticleType.init()
File “C:UsersadminEnvspy3scrapylibsite-packageselasticsearch_dsldocument.py”, line 138, in init
i.save(using=using)
File “C:UsersadminEnvspy3scrapylibsite-packageselasticsearch_dslindex.py”, line 289, in save
current_settings = self.get_settings(using=using)[self._name][‘settings’][‘index’]
KeyError: ‘*’
Process finished with exit code 1
2回答
-
bobby
2019-01-12
你加我qq 442421039 我看看
072019-04-18 -
慕后端2376581
提问者
2019-01-10
elasticsearch 6.5.4
kibana 6.5.400
相似问题