Implement Typesense search integration for Azure Container Apps deployment #787
+1,644
−4
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.
This PR implements a complete Typesense search engine integration to replace Algolia DocSearch, providing a self-hosted search solution designed specifically for Azure Container Apps deployment.
Overview
The integration addresses the need for improved search functionality with full control over the search experience and data privacy. Typesense provides fast, typo-tolerant search with sub-50ms response times while eliminating external service dependencies.
Implementation Details
Backend Services
TypesenseSearchService: HTTP client-based service that handles all Typesense API operations including collection management, document indexing, and search queries. Uses structured configuration and comprehensive error handling.
ContentIndexingService: Extracts and processes content from HTML files using the existing site mapping infrastructure. Cleans HTML content, creates searchable documents, and handles bulk indexing operations.
SearchIndexingHostedService: Background service that automatically indexes all site content on application startup, ensuring search data is always current.
SearchController: REST API endpoints with rate limiting (50 requests/minute) that provide both GET and POST search methods plus health check functionality.
Frontend Components
Modern Search Interface: Replaced the Algolia DocSearch integration with a custom modal-based search interface featuring:
Search Features:
Azure Container Apps Architecture
Deployment Model: Designed to work with the existing Azure Container Apps deployment pipeline:
Configuration: Updated to align with Azure Container Apps deployment patterns, removing conflicting Docker Compose configuration that didn't match the production deployment model.
Key Benefits
Configuration
The integration uses the existing configuration patterns with new
TypesenseOptions
section:Environment variables support secure deployment in Azure Container Apps with Key Vault integration.
Deployment
Azure Container Apps: Comprehensive deployment guide provided in
TYPESENSE_INTEGRATION.md
with:The solution maintains complete backward compatibility while providing a significant upgrade to search functionality. All existing tests pass and the build succeeds without issues.
Fixes #346.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.