Über die API kommt praktisch jede Meldung zweimal, je Portal eine Zeile mit gleichem Text: 9.092 Paare, 53 % des Archivs, bisher jede Fassung self-canonical und in beiden Sitemaps — Google wählte. 1c.7: press_releases.content_hash (SHA-256 über Titel + Text ohne Markup), gesetzt beim Speichern, Bestand per press-releases:hash-content (Query-Builder, Blöcke). Migration in zwei Statements — ADD COLUMN INSTANT, ADD INDEX INPLACE, kein Rebuild. press-releases:duplicates-report zählt Paare je Hauptkategorie. 1c.8: canonical_press_release_id + CanonicalAssigner. Erstquelle folgt der Kategorie (config/canonical.php, Vorschlag zu E9), sonst die zuerst veröffentlichte Fassung. Zuordnung bei jeder Veröffentlichung und über den Bestand (press-releases:assign-canonicals). Die Kopie trägt rel=canonical und mainEntityOfPage auf die Erstquelle; Sitemap und News-Sitemap nennen nur sie; Leser sehen weiterhin beide. Alles hinter CANONICAL_ASSIGNMENT_ENABLED (false), bis E9 entschieden ist. 1c.9: user_canonical in den Index-Prüfungen, sourceVerdict() unterscheidet eigene Adresse / andere eigene Fassung / fremdes Portal; Anzeige im Block „Google-Index" hinter GSC_CUSTOMER_VISIBLE, ohne Aussage über das Warum. Dazu: Abschnitt zur einen Quelle auf /gute-pressemitteilung (Verteiler → viele Kopien, eigene Website zuerst, keine Garantie), noindex in Admin-, Kunden- und Auth-Layouts, UmamiSnippetTest von der lokalen .env gelöst. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\IndexState;
|
|
use App\Enums\Portal;
|
|
use Database\Factories\PressReleaseIndexCheckFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* Eine Momentaufnahme des Indexierungsstatus einer Meldung auf einem Portal
|
|
* (Roadmap 1c.4). Append-only — jeder Prüflauf schreibt eine neue Zeile.
|
|
*/
|
|
class PressReleaseIndexCheck extends Model
|
|
{
|
|
/** @use HasFactory<PressReleaseIndexCheckFactory> */
|
|
use HasFactory;
|
|
|
|
public const ?string CREATED_AT = null;
|
|
|
|
public const ?string UPDATED_AT = null;
|
|
|
|
protected $fillable = [
|
|
'press_release_id',
|
|
'portal',
|
|
'url',
|
|
'state',
|
|
'verdict',
|
|
'coverage_state',
|
|
'indexing_state',
|
|
'robots_txt_state',
|
|
'page_fetch_state',
|
|
'last_crawl_time',
|
|
'google_canonical',
|
|
'user_canonical',
|
|
'raw',
|
|
'checked_at',
|
|
];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'portal' => Portal::class,
|
|
'state' => IndexState::class,
|
|
'last_crawl_time' => 'datetime',
|
|
'checked_at' => 'datetime',
|
|
'raw' => 'array',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<PressRelease, $this>
|
|
*/
|
|
public function pressRelease(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PressRelease::class);
|
|
}
|
|
}
|