more fixes

This commit is contained in:
Ross
2026-07-11 16:54:35 +01:00
parent b703a23fd2
commit a10dd5bd7b
195 changed files with 3943 additions and 128 deletions
+36 -5
View File
@@ -585,7 +585,8 @@ def run_search(root: str, qkey: str, qval: str, mode: str = 'exact', targets: Li
'pageKeywords': fm.get('pageKeywords'),
'reasons': sorted(list(set(reasons))),
'snippet': snippet,
'linked_info': check_linked_sections(content, root)
'linked_info': check_linked_sections(content, root),
'is_cached': True
})
if expand_links:
@@ -616,10 +617,25 @@ def run_search(root: str, qkey: str, qval: str, mode: str = 'exact', targets: Li
'pageKeywords': fm.get('pageKeywords'),
'reasons': [f'Linked (Anatomy of {parent_title})'],
'snippet': content[:300] + '...' if content else '',
'linked_info': check_linked_sections(content, root)
'linked_info': check_linked_sections(content, root),
'is_cached': True
})
seen_docids.add(docid)
seen_paths.add(path)
else:
expanded_results.append({
'path': f"missing_{docid}",
'title': link['title'],
'docid': docid,
'breadcrumbs': [],
'authors': [],
'pageKeywords': [],
'reasons': [f'Linked (Anatomy of {parent_title})'],
'snippet': '',
'linked_info': None,
'is_cached': False
})
seen_paths.add(f"missing_{docid}")
seen_docids.add(docid)
# Differential links
for link in info['differential']['links']:
@@ -637,10 +653,25 @@ def run_search(root: str, qkey: str, qval: str, mode: str = 'exact', targets: Li
'pageKeywords': fm.get('pageKeywords'),
'reasons': [f'Linked (Diff Diag of {parent_title})'],
'snippet': content[:300] + '...' if content else '',
'linked_info': check_linked_sections(content, root)
'linked_info': check_linked_sections(content, root),
'is_cached': True
})
seen_docids.add(docid)
seen_paths.add(path)
else:
expanded_results.append({
'path': f"missing_{docid}",
'title': link['title'],
'docid': docid,
'breadcrumbs': [],
'authors': [],
'pageKeywords': [],
'reasons': [f'Linked (Diff Diag of {parent_title})'],
'snippet': '',
'linked_info': None,
'is_cached': False
})
seen_paths.add(f"missing_{docid}")
seen_docids.add(docid)
out.extend(expanded_results)