mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-04 14:57:56 +10:00
26 lines
506 B
Python
26 lines
506 B
Python
__package__ = 'abx.archivebox'
|
|
|
|
from typing import Iterable, List
|
|
import abc
|
|
|
|
|
|
|
|
class BaseSearchBackend(abc.ABC):
|
|
name: str
|
|
|
|
@staticmethod
|
|
@abc.abstractmethod
|
|
def index(snapshot_id: str, texts: List[str]):
|
|
return
|
|
|
|
@staticmethod
|
|
@abc.abstractmethod
|
|
def flush(snapshot_ids: Iterable[str]):
|
|
return
|
|
|
|
@staticmethod
|
|
@abc.abstractmethod
|
|
def search(text: str) -> List[str]:
|
|
raise NotImplementedError("search method must be implemented by subclass")
|
|
|