forked from endee-io/endee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathingest.py
More file actions
39 lines (30 loc) · 1.16 KB
/
ingest.py
File metadata and controls
39 lines (30 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
"""
ingest.py – Run this once to index all documents into Endee.
Usage:
python ingest.py
python ingest.py --host http://localhost:8080 --recreate
"""
import argparse
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
from indexer import DocumentIndexer
def main():
parser = argparse.ArgumentParser(description="Index industrial documents into Endee.")
parser.add_argument("--host", default="http://localhost:8080", help="Endee server URL")
parser.add_argument("--token", default="", help="Auth token (leave empty if none)")
parser.add_argument("--recreate", action="store_true", help="Drop and recreate the index")
args = parser.parse_args()
print("=" * 55)
print(" IndustrialDocSearch – Endee Document Ingestion")
print("=" * 55)
print(f" Host : {args.host}")
print(f" Recreate: {args.recreate}")
print("=" * 55)
indexer = DocumentIndexer(host=args.host, auth_token=args.token)
indexer.setup(recreate=args.recreate)
print("\n✅ All done! You can now run the app:")
print(" streamlit run app.py")
if __name__ == "__main__":
main()