fix document delete last document
This commit is contained in:
@@ -46,12 +46,35 @@ final class VectorIndexBuilder
|
||||
{
|
||||
$this->assertPreconditions();
|
||||
|
||||
// --------------------------------------------
|
||||
// 🔵 FALL: NDJSON ist leer → kein Vector Index
|
||||
// --------------------------------------------
|
||||
if (filesize($this->indexNdjsonPath) === 0) {
|
||||
|
||||
// Alten Index entfernen
|
||||
@unlink($this->vectorIndexPath);
|
||||
@unlink($this->vectorMetaPath);
|
||||
|
||||
if ($logPath !== null) {
|
||||
@file_put_contents(
|
||||
$logPath,
|
||||
"NDJSON empty → Vector index removed\n",
|
||||
FILE_APPEND
|
||||
);
|
||||
}
|
||||
|
||||
return; // WICHTIG: kein Python, kein tmp, kein Fehler
|
||||
}
|
||||
|
||||
// --------------------------------------------
|
||||
// 🟢 FALL: NDJSON enthält Chunks
|
||||
// --------------------------------------------
|
||||
|
||||
if (!is_file($this->indexMetaPath)) {
|
||||
$this->initializeIndexMeta();
|
||||
}
|
||||
|
||||
$indexMeta = $this->readIndexMeta();
|
||||
|
||||
$embeddingModel = $indexMeta['embedding_model'];
|
||||
|
||||
$tmpVectorIndexPath = $this->vectorIndexPath . '.tmp';
|
||||
|
||||
Reference in New Issue
Block a user