在网上找的资料都是这样的:
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"
本文介绍了一种从旧版到新版Elasticsearch文档模型的变化,包括类别的调整及字段类型的更新等内容。通过对比,展示了如何适配新的文档结构。
1016

被折叠的 条评论
为什么被折叠?



