adhocracy_core.catalog.index module

Custom catalog index.

class ReferenceIndex(discriminator=None)[source]

Bases: substanced.catalog.indexes.SDIndex, hypatia.util.BaseIndexMixin, persistent.Persistent

Use adhocracy_core.graph.Graph.get_source_ids() to query refs.

Initialize self.

family = <BTrees._Family64 object>
document_repr(docid: int, default=None) → str[source]

Read interface.

reset()[source]

Read interface.

index_doc(docid: int, context)[source]

Read interface.

unindex_doc(docid)[source]

Read interface.

reindex_doc(docid, obj)[source]

Read interface.

docids()[source]

Read interface.

indexed()

Read docids docstring.

not_indexed()[source]

Read interface.

eq(query: dict) → hypatia.query.Eq[source]

Concatenate reference query.

Return type:Eq
Parameters:query (dict) –
reference (Reference):
reference with target or source
traverse (bool):
traverse all references with same type, starting with the given target or source.
apply(query: dict) → BTrees.LFBTree.LFTreeSet[source]

Apply reference query.

Return type:LFTreeSet
Parameters:query (dict) –
reference (Reference):
reference with target or source
traverse (bool):
traverse all references with same type, starting with the given target or source.
applyAll(queries: [<class 'dict'>]) → BTrees.LFBTree.LFTreeSet[source]

Apply multiple reference queries.

The result sets are combined with intersection.

applyEq(query: dict) → BTrees.LFBTree.LFTreeSet

Read apply docsting.

search_with_order(reference: adhocracy_core.interfaces.Reference) → hypatia.util.ResultSet[source]

“Search target or source resources ids of reference with order.