"""Type stubs for the native _luci extension module."""

def set_num_threads(num_threads: int) -> None:
    """Configure the number of threads for parallel search. Must be called before any search. Once per process."""

class Index:
    @staticmethod
    def create(path: str, mapping: dict[str, object] | None = None, memory_budget: int | None = None) -> Index:
        """Create a new index. If mapping is None, all fields are dynamically mapped."""
    @staticmethod
    def open(path: str, memory_budget: int | None = None) -> Index:
        """Open an existing index. Mappings are loaded from the index file."""
    def add(self, doc: dict[str, object]) -> None: ...
    def commit(self) -> None: ...
    def force_merge(self, max_segments: int = 1) -> None: ...
    def search(self, query: dict[str, object], size: int = 10) -> dict[str, object]: ...
    def buffered_doc_count(self) -> int: ...
