def index_data(document):
"""Indexes an instance of the Document model in Elasticsearch."""
sha1 = document.file.sha1
es.index(
index=settings.ELASTICSEARCH_INDEX,
doc_type=DOCUMENT_TYPE,
id=sha1,
body=document.parsed,
)
评论列表
文章目录