Traceback (most recent call last):
File “D:/py3scrapy/ArticleSpider_test/ArticleSpider_test/models/es_types.py”, line 29, in
LagouType.init()
File “D:\py3scrapy\lib\site-packages\elasticsearch_dsl\document.py”, line 138, in init
i.save(using=using)
File “D:\py3scrapy\lib\site-packages\elasticsearch_dsl\index.py”, line 289, in save
current_settings = self.get_settings(using=using)[self._name][‘settings’][‘index’]
KeyError: ‘*’
我的代码:
class LagouType(Document):
title = Text(analyzer='ik_max_word')
job_city = Keyword()
class Meta:
index = "lagou"
doc_type = "job"
if name == ‘main’:
LagouType.init()
请老师帮忙看一下
带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎
了解课程