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
|
|
@ -6,14 +6,6 @@ def esc(s):
|
|||
return html.escape(str(s))
|
||||
|
||||
|
||||
def snippet(text, query, ctx=80):
|
||||
pos = text.lower().find(query.lower())
|
||||
if pos == -1:
|
||||
return text[:200]
|
||||
start = max(0, pos - ctx)
|
||||
end = min(len(text), pos + len(query) + ctx)
|
||||
return ("..." if start > 0 else "") + text[start:end] + ("..." if end < len(text) else "")
|
||||
|
||||
|
||||
DEFAULT_TEMPLATE = "<html>\n<head>\n</head>\n<body>\n{{content}}\n</body>\n</html>"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue