Elasticsearch#

WIP - auto-generated documentation. This can be used to imply the index document structures, but it is recommended to refer to the Elasticsearch instance directly.

Objects used to interface with Elasticsearch implementations.

class app.domain.references.models.es.AnnotationDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Persistence model for useful annotation fields in Elasticsearch.

annotation_type: str = InstrumentedField[annotation_type][source]#
label: str = InstrumentedField[label][source]#
scheme: str = InstrumentedField[scheme][source]#
value: bool | None = InstrumentedField[value][source]#
class app.domain.references.models.es.EnhancementContentDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Persistence model for enhancement content in Elasticsearch.

We define anything we want to explicitly index here and map as dynamic in the parent document.

annotations: list[AnnotationDocument] | None = InstrumentedField[annotations][source]#
enhancement_type: EnhancementType = InstrumentedField[enhancement_type][source]#
class app.domain.references.models.es.EnhancementDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Persistence model for enhancements in Elasticsearch.

content: EnhancementContentDocument = InstrumentedField[content][source]#
classmethod from_domain(domain_obj: Enhancement) Self[source]#

Create a persistence model from a domain model.

id: UUID = InstrumentedField[id][source]#
reference_id: UUID = InstrumentedField[reference_id][source]#
robot_version: str | None = InstrumentedField[robot_version][source]#
source: str = InstrumentedField[source][source]#
to_domain(reference_id: UUID) Enhancement[source]#

Create a domain model from this persistence model.

visibility: Visibility = InstrumentedField[visibility][source]#
class app.domain.references.models.es.ExternalIdentifierDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Persistence model for external identifiers in Elasticsearch.

classmethod from_domain(domain_obj: LinkedExternalIdentifier) Self[source]#

Create a persistence model from a domain ExternalIdentifier object.

identifier: str = InstrumentedField[identifier][source]#
identifier_type: ExternalIdentifierType = InstrumentedField[identifier_type][source]#
other_identifier_name: str | None = InstrumentedField[other_identifier_name][source]#
reference_id: UUID = InstrumentedField[reference_id][source]#
to_domain(reference_id: UUID) LinkedExternalIdentifier[source]#

Convert the persistence model into a Domain ExternalIdentifier object.

class app.domain.references.models.es.ReferenceCandidateCanonicalMixin(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Mixin to project Reference fields relevant to deduplication.

authors: list[str] | None = InstrumentedField[authors][source]#
classmethod from_domain(reference: Reference) Self[source]#

Create the ES ReferenceDeduplicationMixin.

classmethod from_projection(projection: CandidateCanonicalSearchFields) Self[source]#

Create a ReferenceCandidateCanonicalMixin from the search projection.

publication_year: int | None = InstrumentedField[publication_year][source]#
title: str | None = InstrumentedField[title][source]#
class app.domain.references.models.es.ReferenceDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: GenericESPersistence[Reference], ReferenceDomainMixin, ReferenceCandidateCanonicalMixin

Persistence model for references in Elasticsearch.

class Index[source]#

Bases: object

Index metadata for the persistence model.

name = "destiny-repository-<MagicMock name='mock.env' id='139886346401264'>-reference"[source]#
classmethod from_domain(domain_obj: Reference) Self[source]#

Create a persistence model from a domain model.

to_domain() Reference[source]#

Create a domain model from this persistence model.

class app.domain.references.models.es.ReferenceDomainMixin(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: InnerDoc

Mapping of Reference domain model to Elasticsearch document.

duplicate_determination: DuplicateDetermination | None = InstrumentedField[duplicate_determination][source]#
enhancements: list[EnhancementDocument] = InstrumentedField[enhancements][source]#
classmethod from_domain(reference: Reference) Self[source]#

Create a ReferenceDomainMixin from a Reference domain model.

identifiers: list[ExternalIdentifierDocument] = InstrumentedField[identifiers][source]#
to_domain() Reference[source]#

Create a domain model from a ReferenceDomainMixin.

visibility: Visibility = InstrumentedField[visibility][source]#
class app.domain.references.models.es.RobotAutomationPercolationDocument(meta: Dict[str, Any] | None = None, **kwargs: Any)[source]#

Bases: GenericESPersistence[RobotAutomation]

Persistence model for robot automation percolation in Elasticsearch.

This model serves two purposes in order to fully define the index: a persistence layer for queries that dictate robot automation, and a percolator layer to convert domain models to queryable documents that run against said queries.

class Index[source]#

Bases: object

Index metadata for the persistence model.

name = "destiny-repository-<MagicMock name='mock.env' id='139886346401264'>-robot-automation-percolation"[source]#
changeset: ReferenceDomainMixin | None = InstrumentedField[changeset][source]#
classmethod from_domain(domain_obj: RobotAutomation) Self[source]#

Create a percolator query from a domain model.

classmethod percolatable_document_from_domain(percolatable: ReferenceWithChangeset) Self[source]#

Create a percolatable document from a domain model.

Parameters:

percolatable (ReferenceWithChangeset) – The percolatable document to convert.

Returns:

The persistence model.

Return type:

RobotAutomationPercolationDocument

query: dict[str, Any] | None = InstrumentedField[query][source]#
reference: ReferenceDomainMixin | None = InstrumentedField[reference][source]#
robot_id: UUID | None = InstrumentedField[robot_id][source]#
to_domain() RobotAutomation[source]#

Create a domain model from this persistence model.

app.domain.references.models.es.get_settings()[source]#