Search Service
NestJS:8015Support
The Search Service provides full-text search capabilities across correspondence, tasks, and comments. It supports fuzzy matching, multi-entity search, and export functionality.
Key Features
- Full-Text Search — Search across multiple entity types
- Fuzzy Matching — Levenshtein distance for approximate matches
- Multi-Entity — Search correspondence, tasks, and comments simultaneously
- Export — Export search results to Excel and PDF
- Search Suggestions — Autocomplete and suggestion support
- Dual Mode — HTTP server + RabbitMQ worker for indexing
- Batch Indexing — Bulk re-indexing capability
API Endpoints
GET
/api/searchSearch across all entities
GET
/api/search/correspondenceSearch correspondence only
GET
/api/search/tasksSearch tasks only
GET
/api/search/suggestionsGet search suggestions
POST
/api/search/export/excelExport search results to Excel
POST
/api/search/export/pdfExport search results to PDF
POST
/api/search/reindexTrigger full re-indexing
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| PORT | number | 8015 | Service listening port |
| DB_HOST | string | localhost | MSSQL server host |
| ELASTICSEARCH_URL | string | http://localhost:9200 | Elasticsearch cluster URL |
| RABBITMQ_URIS | string | - | RabbitMQ connection URIs |
RabbitMQ Integration
Consumes from:
search-eventsexchange — Index update triggers from other services
Dependencies
- Identity Service — Authentication
- Media Service — File content for indexing