docs: register Guanghu OS physical gestation protocols

This commit is contained in:
冰朔 2026-08-01 11:42:04 +08:00
commit 70f0603e76
30 changed files with 679 additions and 50 deletions

View file

@ -15,7 +15,8 @@ function recall(map, query) {
const terms = needle.split(" ").filter(term => term.length >= 2);
if (!needle) return [];
return map.contributions.map(item => {
const identifiers = [item.id, item.arrival_id, ...(item.project_ids || [])];
const identifiers = [item.id, item.arrival_id, ...(item.project_ids || [])]
.filter(value => typeof value === "string" && value.trim());
const keywords = item.keywords || [];
const haystack = normalize([...identifiers, item.arrival_name, item.title, ...keywords].join(" "));
let score = identifiers.reduce((total, id) => total + (needle.includes(normalize(id)) ? 100 : 0), 0);