在网上找的资料都是这样的:
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"