fix: Manticore als Standard-Backend, Xapian-Cleanup in update.sh

- main.go: Default-Backend von "xapian" auf "manticore" geändert
- index.go: Kommentar und Fehlermeldung aktualisiert
- update.sh: Xapian-Verzeichnis wird nach erfolgreichem Manticore-Reindex
  automatisch entfernt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sysops
2026-04-04 20:42:58 +02:00
parent 48cfb7cfa6
commit bde291901a
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -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 {
+3 -2
View File
@@ -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)
}
}
+6
View File
@@ -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