bento_meta.mdb.searchable
mdb.searchable Subclass of class:bento_meta.mdb.MDB to support searching fulltext indices on an MDB Note: certain fulltext indexes on certain MDB nodes and properties must be present in the Neo4j instance: - nodeHandle - propHandle - termValue - termDefn - termValueDefn
Classes
|
Module Contents
- class bento_meta.mdb.searchable.SearchableMDB(uri: str | None = None, user: str | None = None, password: str | None = None)[source]
Bases:
bento_meta.mdb.MDBbento_meta.mdb.MDBsubclass for searching fulltext indices on an MDB.- ftindexes
- available_indexes() dict[str, dict[str, list[str]]][source]
Fulltext indexes present in database.
- Returns:
Dict mapping index_name to dict with entity_type (NODE|RELATIONSHIP), entities ([labels]), properties ([[props]]).
- query_index(index: str, qstring: str, skip: str | None = None, limit: str | None = None) list[dict[str, Any]] | None[source]
Query a named fulltext index of nodes or relationships.
- Parameters:
index – Name of the fulltext index to query.
qstring – Lucene query string.
skip – Number of results to skip.
limit – Maximum number of results to return.
- Returns:
List of dicts with ent (entity dict), label, score (lucene score).
- search_entity_handles(qstring: str) dict[str, list[dict[str, Any]]] | None[source]
Fulltext search of qstring over node, relationship, and property handles.
- Parameters:
qstring – Lucene query string.
- Returns:
Dict with nodes, relationships, properties, each containing list of dicts with ent (entity dict) and score (lucene score).
- search_terms(qstring: str, *, search_values: bool = True, search_definitions: bool = True) list[dict[str, Any]] | None[source]
Fulltext search for qstring over terms, by value, definition, or both (default).
- Parameters:
qstring – Lucene query string.
search_values – If True, search term values.
search_definitions – If True, search term definitions.
- Returns:
List of dicts with ent (term dict) and score (lucene score).