Skip to Content
Services (brain)Current affairs

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

FileRole
current-affairs-bookmark.service.tsSave/remove bookmarks
current-affairs-revision.service.tsBuild revision due lists
current-affairs-bookmark-news-revision.service.tsNews-specific revision
current-affairs-bookmark-news-revision.scheduler.tsCompute 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.

FileReturnsDriven by env
text-search-backend.tscurrentAffairsTextSearchBackend()'regex' | 'atlas'MONGO_ATLAS_SEARCH_ENABLED (truthy → atlas, default regex)
text-search-backend.tscurrentAffairsSearchWindowDays()numberCA_SEARCH_WINDOW_DAYS (default 60)
vector-search-backend.tscurrentAffairsVectorSearchBackend()'in_app' | 'atlas'MONGO_ATLAS_VECTOR_SEARCH_ENABLED (truthy → atlas, default in_app)
vector-search-backend.tscurrentEmbeddingModel()stringEMBEDDING_MODEL (default 'default')
vector-search-backend.tscurrentEmbeddingVersion()numberEMBEDDING_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