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:
-
VeraCollectionIndex–Opened local collection index used by VeraCorpus when it is fresh.
Functions:
-
build_library_index–Build an index atomically and return a machine-readable report.
-
update_library_index–Rebuild an existing library index using its persisted discovery settings.
-
library_index_status–Report whether a library index exists and matches the current file tree.
VeraCollectionIndex
¶
Opened local collection index used by VeraCorpus when it is fresh.
Methods:
-
open– -
close– -
document_paths–Return root-relative archive paths recorded by this generation.
-
inspect_summary–Return corpus metrics from the persistent index without reopening archives.
-
__enter__– -
__exit__– -
supports_where–Return True when every
wherekey is archive metadata or a citation column. -
search–
Attributes:
-
root– -
generation– -
conn– -
skipped_semantic_model_groups(list[dict[str, Any]]) –
skipped_semantic_model_groups
instance-attribute
¶
document_paths
¶
Return root-relative archive paths recorded by this generation.
inspect_summary
¶
Return corpus metrics from the persistent index without reopening archives.
supports_where
¶
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
¶
Report whether a library index exists and matches the current file tree.
See also Collection index design.