feat(search): implement Search module with Typesense full-text & geo search

- TypesenseClient service with configurable connection
- Collection schema for listings with facets, geo-point, and Vietnamese text
- ListingIndexer service with PostGIS coordinate extraction for geo search
- CQRS commands: SyncListing, ReindexAll (batch with pagination)
- CQRS queries: SearchProperties (filters, sorting), GeoSearch (radius)
- Event handlers for listing.approved/updated/deactivated auto-sync
- REST endpoints: GET /search, GET /search/geo, POST /search/reindex (admin)
- DTOs with class-validator validation and pagination

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 01:46:20 +07:00
parent 0b29fac35e
commit 6741592cbe
31 changed files with 1143 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
import { SharedModule } from '@modules/shared';
import { AuthModule } from '@modules/auth';
import { ListingsModule } from '@modules/listings';
import { SearchModule } from '@modules/search';
import { NotificationsModule } from '@modules/notifications';
import { Module } from '@nestjs/common';
import { APP_GUARD } from '@nestjs/core';
@@ -13,6 +15,8 @@ import { AppController } from './app.controller';
CqrsModule.forRoot(),
SharedModule,
AuthModule,
ListingsModule,
SearchModule,
NotificationsModule,
// ── Rate Limiting ──