Public API

sayt2.api is the single import surface for all public names. Internal modules can be reorganised freely — as long as api.py continues to re-export the same names, downstream code is unaffected.

Export list

from .exc import MalformedFieldSettingError
from .exc import MalformedDatasetSettingError
from .exc import TrackerIsLockedError
from .constants import FieldTypeEnum
from .constants import TokenizerEnum
from .constants import NumericKindEnum
from .fields import BaseField
from .fields import StoredField
from .fields import KeywordField
from .fields import TextField
from .fields import NgramField
from .fields import NumericField
from .fields import DatetimeField
from .fields import BooleanField
from .fields import T_Field
from .fields import fields_schema_hash
from .dataset import DataSet
from .dataset import SortKey
from .dataset import Hit
from .dataset import SearchResult
from .tracker import Tracker
from .cache import DataSetCache

The table below groups every exported name by its source module:

  • sayt2.api.FieldTypeEnum

  • sayt2.api.TokenizerEnum

  • sayt2.api.NumericKindEnum

Usage

Import everything you need from a single module:

from sayt2.api import DataSet, NgramField, TextField, KeywordField, SortKey

This is the recommended import style for application code. Importing directly from internal modules (e.g. from sayt2.fields import NgramField) also works but is not covered by the stability guarantee — internal module paths may change between minor versions.