alpha new hybridretriver line

This commit is contained in:
team2
2026-02-26 13:51:54 +01:00
parent ec22f8bbbd
commit 052ff55eda
3 changed files with 129 additions and 41 deletions

View File

@@ -25,17 +25,47 @@ final class VectorSearchClient
$this->agentLogger = $agentLogger;
}
/**
* Standard global search
*/
public function search(string $query, int $limit = 5): array
{
return $this->executeSearch([
'query' => $query,
'limit' => $limit,
]);
}
/**
* Scoped search: nur innerhalb bestimmter Dokumente
*/
public function searchScoped(
string $query,
int $limit,
array $docIds
): array {
if ($docIds === []) {
return [];
}
return $this->executeSearch([
'query' => $query,
'limit' => $limit,
'doc_ids' => array_values($docIds),
]);
}
/**
* Gemeinsame HTTP-Logik (keine Duplikation)
*/
private function executeSearch(array $payload): array
{
try {
$response = $this->http->request(
'POST',
$this->serviceUrl . '/search-chunks',
[
'json' => [
'query' => $query,
'limit' => $limit,
],
'json' => $payload,
'timeout' => 10,
]
);