Skip to content

feat(hybrid-search): implement hybrid search API and documentation#1250

Draft
barbara-celi wants to merge 1 commit into
mainfrom
feat/hybrid-search
Draft

feat(hybrid-search): implement hybrid search API and documentation#1250
barbara-celi wants to merge 1 commit into
mainfrom
feat/hybrid-search

Conversation

@barbara-celi
Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

This PR implements a new /api/search endpoint in the Dev Portal that proxies requests to the VTEX Docs Hybrid Search API. The implementation includes:

  • A Next.js API route (/api/search) that validates input, handles errors, and applies CDN caching.
  • Support for hybrid search backend in the search configuration system alongside Algolia.
  • A feature flag (NEXT_PUBLIC_HYBRID_SEARCH_ENABLED) to switch between Algolia and hybrid search without code changes.

What problem is this solving?

The Dev Portal currently relies entirely on Algolia for search. This implementation:

  • Creates the backend infrastructure needed to consume the new hybrid search API.
  • Ensures only Dev Portal content is returned (hardcoded source=dev-portal).
  • Provides a secure server-side proxy so the hybrid search API key never reaches the browser.
  • Establishes feature parity with the Help Center hybrid search implementation.
  • Enables a consistent search experience across both documentation portals.

How should this be manually tested?

  1. Update the components dependency (temporary, do not commit): In package.json, ensure @vtexdocs/components points to the branch with hybrid search support. For this task, I'm working on the feat/hybrid-search branch. Important: This change is only needed for testing until the vtexdocs/components PR merges to main. Revert this before committing your final changes.
"@vtexdocs/components": "https://github.com/vtexdocs/components.git#feat/hybrid-search"
  1. Run yarn install to fetch the updated components.
  2. Add environment variables to Netlify:
# Hybrid Search (VTEX Docs API)
NEXT_PUBLIC_HYBRID_SEARCH_ENABLED=true
HS_API_ENDPOINT=https://vtexdocs-edge.vtex.com
HS_API_KEY=(obtain from the hybrid search API credentials)
  1. Run yarn dev.

Screenshots or example usage

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@barbara-celi barbara-celi self-assigned this May 5, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for elated-hoover-5c29bf failed. Why did it fail? →

Name Link
🔨 Latest commit 50cd8ab
🔍 Latest deploy log https://app.netlify.com/projects/elated-hoover-5c29bf/deploys/69fa517f351e3a0008452b67

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['release-no', 'release-auto', 'release-patch', 'release-minor', 'release-major']

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

All tests were successful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant