@@ -28,6 +28,7 @@ import {
2828 type WikiClaim ,
2929 type WikiPageSummary ,
3030} from "./markdown.js" ;
31+ import { isPersonLikePage } from "./person-page.js" ;
3132import { initializeMemoryWikiVault } from "./vault.js" ;
3233
3334const QUERY_DIRS = [ "entities" , "concepts" , "sources" , "syntheses" , "reports" ] as const ;
@@ -567,20 +568,6 @@ function hasRouteQuestionMatch(values: readonly string[], queryLower: string): b
567568 return hasAnyQueryMatch ( values , queryLower , buildRouteQuestionTokens ( queryLower ) ) ;
568569}
569570
570- function isPersonLikeSummary (
571- page : Pick < WikiPageSummary , "entityType" | "pageType" | "personCard" > ,
572- ) : boolean {
573- const entityType = normalizeLowercaseStringOrEmpty ( page . entityType ) ;
574- const pageType = normalizeLowercaseStringOrEmpty ( page . pageType ) ;
575- return (
576- Boolean ( page . personCard ) ||
577- entityType === "person" ||
578- entityType === "maintainer" ||
579- pageType === "person" ||
580- pageType === "maintainer"
581- ) ;
582- }
583-
584571function scorePageSearchModeBoost ( params : {
585572 page : QueryableWikiPage ;
586573 matchingClaims : readonly WikiClaim [ ] ;
@@ -593,7 +580,7 @@ function scorePageSearchModeBoost(params: {
593580 case "auto" :
594581 return 0 ;
595582 case "find-person" : {
596- let score = isPersonLikeSummary ( page ) ? 24 : - 4 ;
583+ let score = isPersonLikePage ( page ) ? 24 : - 4 ;
597584 if (
598585 hasAnyQueryMatch (
599586 [
@@ -613,7 +600,7 @@ function scorePageSearchModeBoost(params: {
613600 return score ;
614601 }
615602 case "route-question" : {
616- let score = isPersonLikeSummary ( page ) ? 14 : 0 ;
603+ let score = isPersonLikePage ( page ) ? 14 : 0 ;
617604 if ( hasRouteQuestionMatch ( buildPageRouteQuestionFields ( page ) , queryLower ) ) {
618605 score += 32 ;
619606 }
@@ -664,7 +651,7 @@ function scoreDigestSearchModeBoost(params: {
664651 case "auto" :
665652 return 0 ;
666653 case "find-person" : {
667- let score = isPersonLikeSummary ( page ) ? 24 : - 4 ;
654+ let score = isPersonLikePage ( page ) ? 24 : - 4 ;
668655 if (
669656 hasAnyQueryMatch (
670657 [
@@ -684,7 +671,7 @@ function scoreDigestSearchModeBoost(params: {
684671 return score ;
685672 }
686673 case "route-question" : {
687- let score = isPersonLikeSummary ( page ) ? 14 : 0 ;
674+ let score = isPersonLikePage ( page ) ? 14 : 0 ;
688675 if ( hasRouteQuestionMatch ( buildDigestRouteQuestionFields ( page ) , queryLower ) ) {
689676 score += 32 ;
690677 }
0 commit comments