Chore: Delete the in-memory Tantivy backend and run the search tests on disk (#14216)

TantivyBackend(path=None) built an in-memory index that is not used by production ever used. The backend now requires a path, the open, write-batch and rebuild branches are gone, and the shared backend fixture and the fulltext similar-documents fixture build a real index under the per-test directory layout.
This commit is contained in:
Trenton H
2026-09-22 08:02:16 -07:00
committed by GitHub
parent cb85441c2f
commit e4367b5648
3 changed files with 60 additions and 67 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ if TYPE_CHECKING:
from pytest_django.fixtures import Settings
from documents.models import Document
from paperless_testing.dirs import PaperlessDirs
@pytest.fixture
@@ -30,8 +31,8 @@ def index_dir(tmp_path: Path, settings: Settings) -> Path:
@pytest.fixture
def backend() -> Generator[TantivyBackend, None, None]:
b = TantivyBackend() # path=None → in-memory index
def backend(paperless_dirs: PaperlessDirs) -> Generator[TantivyBackend, None, None]:
b = TantivyBackend(path=paperless_dirs.index_dir)
b.open()
try:
yield b