Scrapy整合Elasticsearch时的KeyError(*)问题解决

在网上找的资料都是这样的:

class ArticleType(DocType):
    suggest = Completion(analyzer=ik_analyzer)
    title = Text(analyzer="ik_max_word")
    create_date = Date()
    url = Keyword()
    url_object_id = Keyword()
    fav_nums = Integer()
    tags = Text(analyzer="ik_max_word")
    content = Text(analyzer="ik_max_word")
    class Meta:
        index = "test"
        doc_type = "movies"

然而现在变成了这样(坑爹,看了文档才发现):

classTest(DocType):
    suggest = Completion(analyzer=ik_analyzer)

    title = Text(analyzer="ik_max_word")
    title_detail = Text(analyzer="ik_max_word")
    url = Keyword()
    class Index:
        name = 'movies'
        settings = {
            "number_of_shards": 2,
        }

    class Meta:
        doc_type = "test"
发布了32 篇原创文章 · 获赞 3 · 访问量 6029

猜你喜欢

转载自blog.csdn.net/PH15045125/article/details/89074037