Search

Search module.

CLI

CLI for Asclepias broker search module.

API

Relationships search API.

class asclepias_broker.search.api.RelationshipAPI[source]

Relationship API.

classmethod get_citations(identifier, with_parents=False, with_siblings=False, expand_target=False)[source]

Get citations of an identfier from the database.

classmethod get_citations2(identifier, relation, grouping_type=<GroupType.Identity: 1>)[source]

Get citations of an identfier from the database.

classmethod print_citations(pid_value)[source]

Print citations of an identifier.

Indexer

Elasticsearch indexing module.

asclepias_broker.search.indexer.build_doc(rel, src_grp=None, trg_grp=None, grouping=None)[source]

Build the ES document for a relationship.

Return type:dict
asclepias_broker.search.indexer.build_group_metadata(group)[source]

Build the metadata for a group object.

Return type:dict
asclepias_broker.search.indexer.build_id_info(id_)[source]

Build information for the Identifier.

Return type:dict
asclepias_broker.search.indexer.build_relationship_metadata(rel)[source]

Build the metadata for a relationship.

Return type:dict
asclepias_broker.search.indexer.delete_group_relations(group_ids)[source]

Delete all relations for given group IDs from ES.

asclepias_broker.search.indexer.index_documents(docs, bulk=False)[source]

Index a list of documents into ES.

asclepias_broker.search.indexer.index_identity_group_relationships(ig_id, vg_id, exclude_group_ids=None)[source]

Build the relationship docs for Identity relations.

asclepias_broker.search.indexer.index_version_group_relationships(group_id, exclude_group_id=None)[source]

Build the relationship docs for Version relations.

asclepias_broker.search.indexer.update_indices(idx_ig, del_ig, idx_vg, del_vg, ig_to_vg_map)[source]

Updates Elasticsearch indices with the updated groups.

Query

Search utilities.

asclepias_broker.search.query.enum_term_filter(label, field, choices)[source]

Term filter with controlled vocabulary.

asclepias_broker.search.query.nested_range_filter(label, field, path=None, op=None)[source]

Nested range filter.

asclepias_broker.search.query.nested_terms_filter(field, path=None)[source]

Nested terms filter.

asclepias_broker.search.query.search_factory(self, search, query_parser=None)[source]

Parse query using elasticsearch DSL query.

Parameters:
  • self – REST view.
  • search – Elastic search DSL search instance.
Returns:

Tuple with search instance and URL arguments.

Tasks

Asynchronous tasks.

(task)asclepias_broker.search.tasks.reindex_all_relationships(destroy: bool=False, split: bool=True)[source]

Reindex all relationship documents.

Views

Search views.

asclepias_broker.search.views.citations(pid_value)[source]

Renders all citations for an identifier.

asclepias_broker.search.views.relationships()[source]

Renders relationships for an identifiers from DB.