Files
pse.dev/app/api/search/indexes/route.ts
Stijn Balk 6d643a0eeb Add research posts to navbar global search, unify all search behaviour and remove algolia dependency. (#575)
* remove algoliasearch and update search with weight (title=100, tags=50, tldr=25, content=10)

* fix project search and update search with regex \bword\b or \bword

* remove algolia dependencies from package.json, yarn.lock, etc.

* Base search on fuse.js, implement same search in projects/ blog/ and navbar search

* add research to navbar search, improve search functionality, update test.
2025-12-02 18:01:23 +01:00

21 lines
505 B
TypeScript

import { NextResponse } from "next/server"
// These should be the same indexes used in the search route
// to ensure consistency
const allIndexes = ["blog", "projects", "research"]
export async function GET() {
try {
return NextResponse.json({
indexes: allIndexes,
status: "success",
})
} catch (error) {
console.error("Error fetching search indexes:", error)
return NextResponse.json(
{ error: "Failed to fetch search indexes" },
{ status: 500 }
)
}
}