Backup #1932
| ID | 1932 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/View/system-explorer/suche.php |
| Version | 1 |
| Typ |
modified |
| Größe | 4.3 KB |
| Hash | 978f3bc2b34d05fdf812392886300a03c6704a7d82a75d38a589bf7c5265d344 |
| Datum | 2025-12-28 01:22:25 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Home</a> » <a href="/explorer">Explorer</a> » <a href="/system-explorer">System Explorer</a> » Suche
</nav>
<h1>Dokumentation durchsuchen</h1>
<p>Hybride Suche: Vektor-Ähnlichkeit (Qdrant) + SQL-Filter.</p>
<form method="get" class="search-form">
<div class="form-group">
<input type="text" name="q" value="<?= htmlspecialchars($query) ?>" placeholder="Suchbegriff eingeben..." class="search-input" autofocus>
</div>
<div class="form-row">
<select name="category">
<option value="">Alle Kategorien</option>
<?php foreach ($categories as $cat): ?>
<option value="<?= htmlspecialchars($cat) ?>" <?= $currentCategory === $cat ? 'selected' : '' ?>><?= htmlspecialchars($cat) ?></option>
<?php endforeach; ?>
</select>
<select name="limit">
<option value="5" <?= $limit === 5 ? 'selected' : '' ?>>5 Ergebnisse</option>
<option value="10" <?= $limit === 10 ? 'selected' : '' ?>>10 Ergebnisse</option>
<option value="20" <?= $limit === 20 ? 'selected' : '' ?>>20 Ergebnisse</option>
</select>
<button type="submit" class="btn btn--primary">Suchen</button>
</div>
</form>
<?php if ($query !== '' && !empty($results)): ?>
<h2>Ergebnisse für "<?= htmlspecialchars($query) ?>"</h2>
<p><?= count($results) ?> Treffer gefunden.</p>
<div class="search-results">
<?php foreach ($results as $i => $r): ?>
<div class="search-result">
<div class="search-result__header">
<span class="search-result__rank"><?= $i + 1 ?>.</span>
<span class="search-result__score"><?= number_format($r['relevance_score'] * 100, 1) ?>%</span>
<a href="/docs/<?= htmlspecialchars($r['path']) ?>" class="search-result__title"><?= htmlspecialchars($r['title']) ?></a>
</div>
<div class="search-result__meta">
<span class="badge"><?= htmlspecialchars(implode(' > ', $r['taxonomy'])) ?></span>
<code><?= htmlspecialchars($r['path']) ?></code>
</div>
<div class="search-result__content">
<?= htmlspecialchars(substr($r['content'], 0, 200)) ?>...
</div>
<?php if (!empty($r['keywords'])): ?>
<div class="search-result__keywords">
<?php foreach (array_slice($r['keywords'], 0, 5) as $kw): ?>
<span class="badge badge--small"><?= htmlspecialchars($kw) ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php if (!empty($suggestions)): ?>
<h3>Verwandte Suchen</h3>
<div class="suggestions">
<?php foreach ($suggestions as $s): ?>
<a href="?q=<?= urlencode($s) ?>&category=<?= urlencode($currentCategory) ?>" class="btn btn--small"><?= htmlspecialchars($s) ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php elseif ($query !== ''): ?>
<p>Keine Ergebnisse für "<?= htmlspecialchars($query) ?>" gefunden.</p>
<?php endif; ?>
<style>
.search-form { margin-bottom: 2rem; }
.search-input { width: 100%; padding: 1rem; font-size: 1.2rem; border: 2px solid var(--color-border); border-radius: 4px; }
.form-row { display: flex; gap: 1rem; margin-top: 1rem; }
.search-results { display: flex; flex-direction: column; gap: 1.5rem; }
.search-result { padding: 1rem; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-bg-alt); }
.search-result__header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.search-result__rank { font-weight: bold; color: var(--color-primary); }
.search-result__score { background: var(--color-success); color: white; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.search-result__title { font-weight: bold; font-size: 1.1rem; }
.search-result__meta { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.search-result__content { margin-bottom: 0.5rem; }
.search-result__keywords { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.suggestions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
</style>
<p class="links-bar">
<a href="/system-explorer">Zurück zum Explorer</a> |
<code>php cli/doc2vector.php search "query"</code>
</p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
Vollständig herunterladen
Aktionen
← Zurück zur Übersicht