Feature: Replace Whoosh with tantivy search backend (#12471)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Antoine Mérino <3023499+Merinorus@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-04-02 12:38:22 -07:00
1 parent e01a762e81
commit aed9abe48c
52 files changed
+4050 -1708

No files matched your search

+3 -11
View File
@@ -1,11 +1,8 @@
import logging
import shutil
from collections.abc import Callable
from collections.abc import Iterable
from datetime import timedelta
from pathlib import Path
from typing import TYPE_CHECKING
from typing import TypeVar
from celery import states
from django.conf import settings
@@ -13,22 +10,17 @@ from django.utils import timezone
from documents.models import Document
from documents.models import PaperlessTask
from documents.utils import IterWrapper
from documents.utils import identity
from paperless_ai.embedding import build_llm_index_text
from paperless_ai.embedding import get_embedding_dim
from paperless_ai.embedding import get_embedding_model
_T = TypeVar("_T")
IterWrapper = Callable[[Iterable[_T]], Iterable[_T]]
if TYPE_CHECKING:
from llama_index.core import VectorStoreIndex
from llama_index.core.schema import BaseNode
def _identity(iterable: Iterable[_T]) -> Iterable[_T]:
return iterable
logger = logging.getLogger("paperless_ai.indexing")
@@ -176,7 +168,7 @@ def vector_store_file_exists():
def update_llm_index(
*,
iter_wrapper: IterWrapper[Document] = _identity,
iter_wrapper: IterWrapper[Document] = identity,
rebuild=False,
) -> str:
"""