diff --git a/cmd/archivmail/main.go b/cmd/archivmail/main.go index 8b16efe..0b6cbd2 100644 --- a/cmd/archivmail/main.go +++ b/cmd/archivmail/main.go @@ -121,7 +121,7 @@ func main() { // Index — per-tenant index manager (PROJ-21 Phase 4) indexBackend := cfg.Index.Backend if indexBackend == "" { - indexBackend = "xapian" + indexBackend = "manticore" } batchSize := cfg.Index.BatchSize if batchSize <= 0 { diff --git a/internal/index/index.go b/internal/index/index.go index 172cb2d..6561b7c 100644 --- a/internal/index/index.go +++ b/internal/index/index.go @@ -55,7 +55,7 @@ type Indexer interface { } // TenantIndexer manages per-tenant Indexer instances. -// Implemented by TenantIndexManager (Xapian) and ManticoreTenantManager. +// Implemented by ManticoreTenantManager (primary) and TenantIndexManager (legacy Xapian). type TenantIndexer interface { ForTenant(tenantID *int64) Indexer Global() Indexer @@ -63,11 +63,12 @@ type TenantIndexer interface { } // New creates an Indexer for the specified backend. +// Deprecated: use NewManticoreTenantManager instead. func New(dir string, batchSize int, backend string) (Indexer, error) { switch backend { case "xapian": return newXapian(dir) default: - return nil, fmt.Errorf("unknown index backend: %q (supported: xapian)", backend) + return nil, fmt.Errorf("unknown index backend: %q (use manticore via NewManticoreTenantManager)", backend) } } diff --git a/update.sh b/update.sh index 58eff55..caf28f9 100755 --- a/update.sh +++ b/update.sh @@ -182,6 +182,12 @@ if grep -q 'backend: manticore' /etc/archivmail/config.yml 2>/dev/null \ info "Baue Manticore-Suchindex auf (alle Mails)..." if timeout 600 /opt/archivmail/bin/archivmail reindex --config /etc/archivmail/config.yml; then log "Manticore-Index aufgebaut" + # Xapian-Altdaten entfernen (nach erfolgreichem Manticore-Reindex) + XAPIAN_DIR="/var/archivmail/xapian" + if [[ -d "$XAPIAN_DIR" ]]; then + rm -rf "$XAPIAN_DIR" + log "Xapian-Altdaten entfernt ($XAPIAN_DIR)" + fi else warn "Reindex nicht abgeschlossen — bei Bedarf manuell: archivmail reindex" fi