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 我看看

0
7
bobby
回复
慕函数3218068
你的es和es_dsl是哪个版本 最好都使用es5版本
2019-04-18
共7条回复

慕后端2376581

提问者

2019-01-10

elasticsearch 6.5.4
kibana 6.5.4

0
0

Scrapy打造搜索引擎 畅销4年的Python分布式爬虫课

带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎

5796 学习 · 6290 问题

查看课程