This commit is contained in:
1 parent
c492f97a67
commit
487e28a904
2 files changed
+100
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
scripts/ensure_indexes_and_show.py
|
||||
Erzwingt/prüft die Index-Erstellung via ensure_payload_indexes(...) und zeigt danach das payload_schema.
|
||||
|
||||
Aufruf:
|
||||
python3 -m scripts.ensure_indexes_and_show
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import json
|
||||
from app.core.qdrant import QdrantConfig, get_client, ensure_payload_indexes, collection_names
|
||||
|
||||
def main():
|
||||
cfg = QdrantConfig.from_env()
|
||||
client = get_client(cfg)
|
||||
ensure_payload_indexes(client, cfg.prefix)
|
||||
# Danach anzeigen
|
||||
notes, chunks, edges = collection_names(cfg.prefix)
|
||||
cols = [notes, chunks, edges]
|
||||
res = {}
|
||||
for name in cols:
|
||||
info = client.get_collection(collection_name=name)
|
||||
d = info.dict() if hasattr(info, "dict") else info
|
||||
res[name] = d.get("result", {}).get("payload_schema")
|
||||
print(json.dumps(res, ensure_ascii=False, indent=2))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user