Skip to content
Snippets Groups Projects
Commit 65486f11 authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Index structure metadata in ES

parent f2908f33
No related branches found
No related tags found
No related merge requests found
from arkindex_common.enums import MetaType
from collections.abc import Sequence
from itertools import chain
from django.conf import settings
......@@ -94,6 +95,7 @@ class ESElement(Document):
corpus = Keyword()
# Used exclusively for sorting
parents = Keyword()
structure = Keyword()
transcriptions = Nested(ESTranscriptionInnerDoc)
date_range = RawDateRange(format='yyyy||yyyy-MM||yyyy-MM-dd')
......@@ -136,6 +138,10 @@ class ESElement(Document):
element.name
for element in Element.objects.get_ascending(instance.id)
],
structure=[
md.value
for md in instance.metadatas.filter(type=MetaType.Structure)
],
transcriptions=list(map(
ESTranscriptionInnerDoc.from_model,
transcriptions,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment