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