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/search

Search across all entities

GET
/api/search/correspondence

Search correspondence only

GET
/api/search/tasks

Search tasks only

GET
/api/search/suggestions

Get search suggestions

POST
/api/search/export/excel

Export search results to Excel

POST
/api/search/export/pdf

Export search results to PDF

POST
/api/search/reindex

Trigger full re-indexing

Configuration

NameTypeDefaultDescription
PORTnumber8015Service listening port
DB_HOSTstringlocalhostMSSQL server host
ELASTICSEARCH_URLstringhttp://localhost:9200Elasticsearch cluster URL
RABBITMQ_URISstring-RabbitMQ connection URIs

RabbitMQ Integration

Consumes from:

  • search-events exchange — Index update triggers from other services

Dependencies

  • Identity Service — Authentication
  • Media Service — File content for indexing