/[sudobot]/trunk/docs/app/search/route.ts
ViewVC logotype

Diff of /trunk/docs/app/search/route.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 625 by rakinar2, Mon Jul 29 17:59:26 2024 UTC revision 626 by rakinar2, Sat Sep 7 09:38:45 2024 UTC
# Line 24  export async function GET(request: NextR Line 24  export async function GET(request: NextR
24    
25      if (lowercasedIndex) {      if (lowercasedIndex) {
26          for (const i in lowercasedIndex) {          for (const i in lowercasedIndex) {
27                if (results.length >= 15) {
28                    break;
29                }
30    
31              const titleIncludes = lowercasedIndex[i].title?.includes(query);              const titleIncludes = lowercasedIndex[i].title?.includes(query);
32              const descriptionIncludes =              const descriptionIncludes =
33                  lowercasedIndex[i].description?.includes(query);                  lowercasedIndex[i].description?.includes(query);
# Line 35  export async function GET(request: NextR Line 39  export async function GET(request: NextR
39                      match: titleIncludes                      match: titleIncludes
40                          ? ("title" as const)                          ? ("title" as const)
41                          : descriptionIncludes                          : descriptionIncludes
42                          ? ("description" as const)                            ? ("description" as const)
43                          : ("data" as const),                            : ("data" as const),
44                  });                  });
45              }              }
46          }          }

Legend:
Removed from v.625  
changed lines
  Added in v.626

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26