Advanced search endpoint leveraging Elasticsearch for text, vector, and hybrid queries with faceting and event tracking
POST
function is the main export of this component, serving as the handler for incoming search requests. It accepts a NextRequest
object and returns a Promise<NextResponse>
, encapsulating the entire search process from request parsing to response generation.
Data Flow
Request Validation Errors
Search Execution Errors
Event Logging Errors
VECTOR_DIMENSIONS
: Set to 3072, defines the expected size of vector embeddings