Current affairs services
current-affairs.service.ts
Main entry: load daily issues, items, publish workflow hooks.
current-affairs-ancillary.service.ts
Supporting operations (related PYQ, search helpers, editorial utilities).
Bookmark & revision
| File | Role |
|---|---|
current-affairs-bookmark.service.ts | Save/remove bookmarks |
current-affairs-revision.service.ts | Build revision due lists |
current-affairs-bookmark-news-revision.service.ts | News-specific revision |
current-affairs-bookmark-news-revision.scheduler.ts | Compute next review dates |
Uses utils: current-affairs-search-expand.ts, ca-local-datetime.ts, nexus-entity-status.ts.
Search backend selectors
Folder: services/current-affairs-search/
Tiny helpers that decide which MongoDB feature backs full-text and vector queries. They never run queries themselves — the calling service reads the flag and picks the code path.
| File | Returns | Driven by env |
|---|---|---|
text-search-backend.ts | currentAffairsTextSearchBackend() → 'regex' | 'atlas' | MONGO_ATLAS_SEARCH_ENABLED (truthy → atlas, default regex) |
text-search-backend.ts | currentAffairsSearchWindowDays() → number | CA_SEARCH_WINDOW_DAYS (default 60) |
vector-search-backend.ts | currentAffairsVectorSearchBackend() → 'in_app' | 'atlas' | MONGO_ATLAS_VECTOR_SEARCH_ENABLED (truthy → atlas, default in_app) |
vector-search-backend.ts | currentEmbeddingModel() → string | EMBEDDING_MODEL (default 'default') |
vector-search-backend.ts | currentEmbeddingVersion() → number | EMBEDDING_VERSION (default 1) |
Production (Atlas + vector search enabled) flips both flags to true. Local dev runs the regex + in_app paths so no Atlas-only features are required.
Last updated on