Types

Contains custom types and typing related methods.

class elasticwrap.types.Document(_typename, _fields=None, /, **kwargs)

Bases: PostDocument[AnySourceDocument]

General class to model es documents as returned by search clients.

Specific documents should be defined by the relevant search client.

class elasticwrap.types.LogicalComp(value)

Bases: Enum

An Enum to limit and map various logical operators. Mostly used for ES dates.

GT = 'gt'
GTE = 'gte'
LT = 'lt'
LTE = 'lte'
class elasticwrap.types.PercevalDataDocument(_typename, _fields=None, /, **kwargs)

Bases: dict

A generic TypedDict intended to define actual data as gathered by Perceval.

If you want to define data gathered by Perceval, you should extend this class.

class elasticwrap.types.PercevalSourceDocument(_typename, _fields=None, /, **kwargs)

Bases: SourceDocument, Generic[AnyPercevalDataDocument]

A model that pre-defines some metadata fields as created by Perceval.

backend_name: str
backend_version: str
category: str
classified_fields_filtered: Optional[List[str]]
data: AnyPercevalDataDocument
metadata__timestamp: str
metadata__updated_on: str
origin: str
perceval_version: str
search_fields: dict
tag: str
timestamp: float
updated_on: float
uuid: str
class elasticwrap.types.PostDocument(_typename, _fields=None, /, **kwargs)

Bases: TypedDict, Generic[AnySourceDocument]

Model of fields that are required when posting to ES

class elasticwrap.types.SourceDocument(_typename, _fields=None, /, **kwargs)

Bases: dict

General class to model the _source document that is returned by search clients.

If you want to define data NOT gathered by Perceval, you should extend this class.

See also

Document