feat(api): add /api/v1/search/v2 endpoint#143
Merged
Conversation
|
@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
1e0498e to
c0d165b
Compare
c0d165b to
490dfc1
Compare
- New route: POST /api/v1/search/v2 - Uses hybrid search with BM25 + semantic + Cohere reranking - Returns function-level results with AI summaries - Feature flag: SEARCH_V2_ENABLED (default: true) - Consistent API versioning: all endpoints under /api/v1/* - 4 tests passing
490dfc1 to
12aaa02
Compare
Collaborator
Author
✅ PR Review Complete - Ready to MergeEndpoint verified: Route Structure (Confirmed)Files Changed
Tests4 passed ✅📋 Next Steps After Merge@kiran-devops (Kiran)
@arjun-frontend (Arjun)
@devanshu (Raj)
🎯 Search V2 Backend Status: COMPLETE
Total: 47 tests passing across all Search V2 modules |
Collaborator
Author
PR Review Complete - Ready to MergeEndpoint: Tests: 4 passed Next Steps After MergeDevOps:
Frontend:
Backend:
Search V2 Backend Status
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Search V2 API Endpoint
Closes #142
Endpoint
Request
{ "query": "authentication middleware", "repo_id": "uuid", "top_k": 10, "use_reranking": true }Response
{ "results": [ { "name": "authenticate_user", "qualified_name": "auth.middleware.authenticate_user", "file_path": "src/auth/middleware.py", "code": "def authenticate_user(request): ...", "signature": "def authenticate_user(request: Request) -> User", "language": "python", "score": 0.92, "line_start": 45, "line_end": 67, "summary": "Validates JWT token and returns authenticated user", "class_name": null } ], "query": "authentication middleware", "total": 10, "cached": false, "search_version": "v2" }API Versioning Strategy
All endpoints stay under
/api/v1/*:/api/v1/search→ V1 (file-level, basic)/api/v1/search/v2→ V2 (function-level, hybrid ranking)"v2" is a feature version of search, not an API version bump. When Search V2 becomes stable and default, it will replace
/api/v1/search.Features
SEARCH_V2_ENABLEDFiles Changed
backend/routes/search_v2.py(NEW)backend/main.py(register route).env.example(add COHERE_API_KEY, SEARCH_V2_ENABLED)backend/tests/test_search_v2_route.py(NEW - 4 tests)Testing
DevOps
Add to production env: