docs: register Guanghu OS physical gestation protocols
This commit is contained in:
parent
5973c0e7fb
commit
70f0603e76
30 changed files with 679 additions and 50 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue