Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/src/services/database_seeding_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ class DatabaseSeedingService {
.collection('sources')
.createIndex(keys: {'name': 'text'}, name: 'sources_text_index');

// Indexes for country aggregation queries
await _db
.collection('headlines')
.createIndex(
keys: {'status': 1, 'eventCountry.id': 1},
name: 'status_eventCountry_index',
);
await _db
.collection('sources')
.createIndex(
keys: {'status': 1, 'headquarters.id': 1},
name: 'status_headquarters_index',
);

// --- TTL and Unique Indexes via runCommand ---
// The following indexes are created using the generic `runCommand` because
// they require specific options not exposed by the simpler `createIndex`
Expand Down
Loading