feat(news): add scraper adapters, article deduplication, blocklist service, and remove tracked publish artifacts
This commit is contained in:
@@ -41,9 +41,9 @@ public class NewsDbContext : DbContext, ISettingsDbContext
|
||||
public DbSet<MatchedAssetEntity> MatchedAssets => Set<MatchedAssetEntity>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the database set for microservice configuration settings.
|
||||
/// Gets or sets the database set for blocked news URLs (unindexable or duplicate articles).
|
||||
/// </summary>
|
||||
public DbSet<NewsSettingsEntity> Settings => Set<NewsSettingsEntity>();
|
||||
public DbSet<BlockedNewsUrlEntity> BlockedNewsUrls => Set<BlockedNewsUrlEntity>();
|
||||
|
||||
/// <summary>
|
||||
/// Configures the model mapping, database constraints, and unique indices.
|
||||
@@ -64,16 +64,27 @@ public class NewsDbContext : DbContext, ISettingsDbContext
|
||||
.HasIndex(a => a.SourceUrl)
|
||||
.IsUnique();
|
||||
|
||||
// Performance indexes for news queries
|
||||
// Performance & deduplication indexes for news queries
|
||||
modelBuilder.Entity<NewsArticleEntity>()
|
||||
.HasIndex(a => new { a.PublishedAt, a.ScrapedAt });
|
||||
|
||||
modelBuilder.Entity<NewsArticleEntity>()
|
||||
.HasIndex(a => a.Status);
|
||||
|
||||
modelBuilder.Entity<NewsArticleEntity>()
|
||||
.HasIndex(a => a.TitleHash);
|
||||
|
||||
modelBuilder.Entity<NewsArticleEntity>()
|
||||
.HasIndex(a => a.SimHash);
|
||||
|
||||
modelBuilder.Entity<MatchedAssetEntity>()
|
||||
.HasIndex(m => m.Isin);
|
||||
|
||||
// Blocked URLs index
|
||||
modelBuilder.Entity<BlockedNewsUrlEntity>()
|
||||
.HasIndex(b => b.Url)
|
||||
.IsUnique();
|
||||
|
||||
// Configure relationship between NewsArticle and MatchedAssets
|
||||
modelBuilder.Entity<MatchedAssetEntity>()
|
||||
.HasOne(m => m.NewsArticle)
|
||||
|
||||
Reference in New Issue
Block a user