{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, identifier, kv, operations_journey %} {% block content %} {% set latest = versions[0] if versions else None %} {% call page_header(document.title, document.external_id) %}
{% if document.source_deleted %}{{ badge("Retired", "neutral") }} {% elif latest and latest.state.value == "published" %}{{ badge("Searchable", "ok") }} {% elif latest and latest.state.value == "failed" %}{{ badge("Failed", "error") }} {% elif latest %}{{ badge("Processing", "info") }} {% else %}{{ badge("No version", "neutral") }}{% endif %}
{% endcall %} {% set journey_job = jobs.get(latest.job_id) if latest and latest.job_id else None %} {{ operations_journey( source_url="/admin/sources/" ~ source.id if source else None, source_label=source.name if source else "Source unavailable", document_url="/admin/documents/" ~ document.id, document_label=document.title, job_url="/admin/jobs/" ~ journey_job.id if journey_job else None, job_label="Job " ~ (journey_job.id | string)[:8] ~ "…" if journey_job else "Job unavailable", current="document" ) }} {% if latest and latest.state.value == "failed" %} {% endif %}

Overview

{{ kv("Title", document.title) }}
Source
{% if source %}{{ source.name }} ({{ source.kind.value }}){% else %}{{ identifier(document.source_id) }}{% endif %}
{{ kv("Item in source", document.external_id, mono=True) }} {{ kv("Knowledge space", space_name or document.space_id) }} {{ kv("Content type", content_type) }} {{ kv("Language", language) }} {{ kv("Trust level", trust_level) }} {% if shown %} {{ kv("Shown version", state_labels.get(shown.state.value, shown.state.value) ~ (" · " ~ shown.created_at.strftime("%Y-%m-%d %H:%M") if shown.created_at else "")) }} {{ kv("Parser", shown.parser_version, mono=True) }} {{ kv("Chunk profile", shown.chunk_profile_version, mono=True) }} {{ kv("OCR used", ocr_used) }} {{ kv("Content hash", shown.content_hash, mono=True) }} {{ kv("Source fingerprint", shown.source_fingerprint, mono=True) }} {% if shown.source_revision %}{{ kv("Source revision", shown.source_revision, mono=True) }}{% endif %} {{ kv("Chunks indexed", chunks | length) }} {% endif %}
Document ID
{{ identifier(document.id, "document-id", short=36) }}

Versions

{% if not versions %}

No version has been recorded for this document yet.

{% else %}
    {% for version in versions %}
  1. {{ version.created_at.strftime("%Y-%m-%d %H:%M") if version.created_at else "Version" }}{% if shown and version.id == shown.id %} (shown){% endif %} {% if version.state.value == "published" %}{{ badge("Searchable", "ok") }} {% elif version.state.value == "failed" %}{{ badge("Failed", "error") }} {% elif version.state.value in ("superseded", "retired") %}{{ badge(version.state.value | capitalize, "neutral") }} {% else %}{{ badge("Processing", "info") }}{% endif %}

    {{ version.parser_version }} · {{ version.chunk_profile_version }}{% if version.failure_code %} · {{ version.failure_code }}{% endif %}

    {{ identifier(version.id, "version-" ~ loop.index) }}

  2. {% endfor %}
{% endif %}

Chunks sent to retrieval

{{ chunks | length }} child chunks{% if parent_count %} · {{ parent_count }} parent chunks (context only){% endif %}

{% if not chunks %}

{% if shown and shown.state.value == "failed" %}This version failed before any chunk was stored.{% elif shown and shown.state.value != "published" %}Chunks are stored when the version is published.{% else %}No chunks are stored for this version.{% endif %}

{% else %}
    {% for chunk in chunks %}
  1. #{{ loop.index }} {{ chunk.structure_path }} {% if chunk.metadata.get("section") %}· {{ chunk.metadata.get("section") }}{% endif %} {% if chunk.metadata.get("page_start") %}· p. {{ chunk.metadata.get("page_start") }}{% if chunk.metadata.get("page_end") and chunk.metadata.get("page_end") != chunk.metadata.get("page_start") %}–{{ chunk.metadata.get("page_end") }}{% endif %}{% endif %} {% if chunk.metadata.get("line_start") %}· lines {{ chunk.metadata.get("line_start") }}–{{ chunk.metadata.get("line_end") }}{% endif %} · {{ chunk.token_count }} tokens {{ identifier(chunk.id, "chunk-" ~ loop.index) }}
    {{ chunk.content }}
  2. {% endfor %}
{% endif %}

Artifacts & metadata

{% if artifacts %}
{% for artifact in artifacts %} {{ kv(artifact.kind ~ " artifact", artifact.storage_key ~ " (" ~ artifact.size_bytes ~ " bytes, sha256 " ~ artifact.content_hash[:16] ~ "…)", mono=True) }} {% endfor %}
{% else %}

No parsed artifact is stored for the shown version.

{% endif %}

Ingestion jobs

{% if not jobs %}

No job is linked to this document's versions (versions created before job linking existed show no job).

{% else %} {% endif %}
{% endblock %}