Initialize and return a Neo4jVector instance from an existing graph.
This method initializes a Neo4jVector instance using the provided parameters and the existing graph. It validates the existence of the indices and creates new ones if they don't exist.
from_existing_graph(
cls: Type[Neo4jVector],
embedding: Embeddings,
node_label: str,
embedding_node_property: str,
text_node_properties: List[str],
*,
keyword_index_name: Optional[str] = 'keyword',
index_name: str = 'vector',
search_type: SearchType = DEFAULT_SEARCH_TYPE,
retrieval_query: str = '',
**kwargs: Any = {}
) -> Neo4jVectorNeo4jVector: An instance of Neo4jVector initialized with the provided parameters and existing graph.
Example:
neo4j_vector = Neo4jVector.from_existing_graph(
embedding=my_embedding,
node_label="Document",
embedding_node_property="embedding",
text_node_properties=["title", "content"]
)
Neo4j credentials are required in the form of url, username, and
password, and optional database parameters passed as additional keyword
arguments.