Backup #1700

ID1700
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/semantic-explorer/suche.php
Version2
Typ modified
Größe2.4 KB
Hashf51456e56aa117ed612b4731adfbdb4ca51213c59456eaf7643156ebd869beae
Datum2025-12-27 12:18:36
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Write-Operation
Datei existiert Ja

Dateiinhalt

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/">Campus KI</a> &raquo; <a href="/semantic-explorer">Semantic Explorer</a> &raquo; Suche
</nav>

<h1>Semantische Suche</h1>
<p>Vektor-basierte Suche in Nutzdaten (Qdrant documents Collection).</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="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 fuer "<?= htmlspecialchars($query) ?>"</h2>
<p><?= count($results) ?> Treffer gefunden.</p>

<table data-sortable>
    <thead>
        <tr>
            <th data-sort="rank">#</th>
            <th data-sort="score">Score</th>
            <th data-sort="filename">Dokument</th>
            <th data-sort="tokens">Tokens</th>
            <th data-sort="content">Inhalt</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($results as $i => $r): ?>
        <tr>
            <td><?= $i + 1 ?></td>
            <td><span class="badge badge--success"><?= number_format($r['score'] * 100, 1) ?>%</span></td>
            <td>
                <a href="/semantic-explorer/chunks/<?= $r['id'] ?>">#<?= $r['id'] ?></a>
                <br><small><a href="/semantic-explorer/dokumente/<?= $r['document_id'] ?>"><?= htmlspecialchars($r['filename']) ?></a></small>
            </td>
            <td><?= $r['token_count'] ?></td>
            <td><?= htmlspecialchars(substr($r['content'], 0, 150)) ?>...</td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<?php elseif ($query !== ''): ?>
<p>Keine Ergebnisse fuer "<?= htmlspecialchars($query) ?>" gefunden.</p>
<p>Stellen Sie sicher, dass Dokumente mit Embeddings vorliegen.</p>
<?php endif; ?>

<p class="links-bar">
    <a href="/semantic-explorer">Zurueck zum Explorer</a>
</p>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1700 2 modified 2.4 KB 2025-12-27 12:18
1627 1 modified 2.4 KB 2025-12-27 09:44

← Zurück zur Übersicht