Skip to content

Library index

This is an automatically generated API reference for rebuildable library-level search indexes (.vera-index/).

collection

Rebuildable library-level search index for collections of .vera files.

Classes:

Functions:

VeraCollectionIndex

VeraCollectionIndex(
    root: Path, generation: Path, conn: Connection
)

Opened local collection index used by VeraCorpus when it is fresh.

Methods:

Attributes:

root instance-attribute

root = root

generation instance-attribute

generation = generation

conn instance-attribute

conn = conn

skipped_semantic_model_groups instance-attribute

skipped_semantic_model_groups: list[dict[str, Any]] = []

open classmethod

open(
    directory: str, *, check_status: bool = True
) -> VeraCollectionIndex

close

close() -> None

document_paths

document_paths(
    *, include_skipped: bool = True
) -> list[str]

Return root-relative archive paths recorded by this generation.

inspect_summary

inspect_summary() -> dict[str, Any]

Return corpus metrics from the persistent index without reopening archives.

__enter__

__enter__() -> VeraCollectionIndex

__exit__

__exit__(*exc: object) -> None

supports_where

supports_where(where: Mapping[str, Any] | None) -> bool

Return True when every where key is archive metadata or a citation column.

search

search(
    query: str,
    mode: str = "hybrid",
    top_k: int = 10,
    *,
    where: Mapping[str, Any] | None = None,
) -> list[IndexHit]

build_library_index

build_library_index(
    directory: str,
    *,
    recursive: bool = False,
    excludes: Iterable[str] = (),
    includes: Iterable[str] = (),
    operation: str = "build",
    progress: Callable[[dict[str, Any]], None]
    | None = None,
) -> dict[str, Any]

Build an index atomically and return a machine-readable report.

progress receives factual phase updates with per-file counts. Callers can surface these updates without inspecting an index while it is being assembled.

update_library_index

update_library_index(
    directory: str,
    *,
    progress: Callable[[dict[str, Any]], None]
    | None = None,
) -> dict[str, Any]

Rebuild an existing library index using its persisted discovery settings.

library_index_status

library_index_status(
    directory: str, *, verify_hashes: bool = True
) -> dict[str, Any]

Report whether a library index exists and matches the current file tree.

See also Collection index design.