@@ -95,14 +95,37 @@ def _get_search_results(
95
95
If no embedder is provided, then it will assume that the vectorizer is used in Weaviate.
96
96
97
97
See the following documentation for more details:
98
- - [Query a vector index](https://neo4j.com/docs/cypher-manual/current/indexes-for-vector-search/#indexes-vector-query)
99
- - [db.index.vector.queryNodes()](https://neo4j.com/docs/operations-manual/5/reference/procedures/#procedure_db_index_vector_queryNodes)
100
- - [db.index.fulltext.queryNodes()](https://neo4j.com/docs/operations-manual/5/reference/procedures/#procedure_db_index_fulltext_querynodes)
98
+ - `Query a vector index <https://neo4j.com/docs/cypher-manual/current/indexes-for-vector-search/#indexes-vector-query>`_
99
+ - `db.index.vector.queryNodes() <https://neo4j.com/docs/operations-manual/5/reference/procedures/#procedure_db_index_vector_queryNodes>`_
100
+ - `db.index.fulltext.queryNodes() <https://neo4j.com/docs/operations-manual/5/reference/procedures/#procedure_db_index_fulltext_querynodes>`_
101
+
102
+
103
+ Example:
104
+
105
+ .. code-block:: python
106
+
107
+ import neo4j
108
+ from neo4j_genai.retrievers import WeaviateNeo4jRetriever
109
+
110
+ driver = neo4j.GraphDatabase.driver(URI, auth=AUTH)
111
+
112
+ retriever = WeaviateNeo4jRetriever(
113
+ driver=driver,
114
+ client=weaviate_client,
115
+ collection="Jeopardy",
116
+ id_property_external="neo4j_id",
117
+ id_property_neo4j="id",
118
+ )
119
+
120
+ biology_embedding = ...
121
+ retriever.search(query_vector=biology_embedding, top_k=2)
122
+
123
+
101
124
Args:
102
- query_text (str): The text to get the closest neighbors of.
103
- query_vector (Optional[list[float]], optional ): The vector embeddings to get the closest neighbors of. Defaults to None.
104
- top_k (int, optional ): The number of neighbors to return. Defaults to 5.
105
- weaviate_filters (Optional[_Filters], optional ): The filters to apply to the search query in Weaviate. Defaults to None.
125
+ query_text (Optional[ str] ): The text to get the closest neighbors of.
126
+ query_vector (Optional[list[float]]): The vector embeddings to get the closest neighbors of. Defaults to None.
127
+ top_k (int): The number of neighbors to return. Defaults to 5.
128
+ weaviate_filters (Optional[_Filters]): The filters to apply to the search query in Weaviate. Defaults to None.
106
129
Raises:
107
130
SearchValidationError: If validation of the input arguments fail.
108
131
Returns:
0 commit comments