Make semantic search and reranking optional, use site meta descriptions for snippets
- Add semantic_search setting to toggle AI-powered search on/off - Skip embedding generation, hybrid search, and model preloading when disabled - Use site owner's meta description as snippet instead of heuristic extraction - Remove _generate_summary() and snippet() - no more generated snippets - Show reranker/reindex controls grayed out when semantic search is off - AI dependencies (onnxruntime, hnswlib, etc.) are now fully optional Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c9a8cba9d1
commit
c959ee98ae
5 changed files with 70 additions and 118 deletions
|
|
@ -507,7 +507,7 @@ def hybrid_search(query_text, bm25_ranked_ids, limit=10, db=None, use_reranker=F
|
|||
|
||||
def reindex_all(db=None, progress_callback=None):
|
||||
"""Re-embed all pages and regenerate all summaries. Rebuilds HNSW index."""
|
||||
from db import get_db, return_db, _generate_summary
|
||||
from db import get_db, return_db
|
||||
own_db = db is None
|
||||
if own_db:
|
||||
db = get_db()
|
||||
|
|
@ -523,11 +523,6 @@ def reindex_all(db=None, progress_callback=None):
|
|||
total = len(rows)
|
||||
for i, row in enumerate(rows):
|
||||
store_embeddings(row["id"], row["title"], row["body"], db)
|
||||
# Only regenerate summary if missing
|
||||
if not row["summary"]:
|
||||
summary = _generate_summary(row["title"], row["body"])
|
||||
db.execute("UPDATE pages SET summary = ? WHERE id = ?", (summary, row["id"]))
|
||||
db.commit()
|
||||
if progress_callback:
|
||||
progress_callback(i + 1, total)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue