This commit is contained in:
jonaswinkler
2020-12-05 00:37:05 +01:00
parent cd5587b511
commit 17af581425
3 changed files with 17 additions and 7 deletions

View File

@@ -82,6 +82,10 @@ def open_index(recreate=False):
def update_document(writer, doc):
# TODO: this line caused many issues all around, since:
# We need to make sure that this method does not get called with
# deserialized documents (i.e, document objects that don't come from
# Django's ORM interfaces directly.
logger.debug("Indexing {}...".format(doc))
tags = ",".join([t.name for t in doc.tags.all()])
writer.update_document(
@@ -98,6 +102,7 @@ def update_document(writer, doc):
def remove_document(writer, doc):
# TODO: see above.
logger.debug("Removing {} from index...".format(doc))
writer.delete_by_term('id', doc.pk)