Skip to content
Snippets Groups Projects
Commit 3a698009 authored by Valentin Rigal's avatar Valentin Rigal Committed by Erwan Rouchet
Browse files

Index structure metadata in ES

parent 38376019
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