more fixes
This commit is contained in:
+36
-5
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user