Skip to content

Commit 3c955f7

Browse files
author
Sam Partee
authored
Documentation Update (#37)
GA and user guide fixes
1 parent 622e82c commit 3c955f7

File tree

2 files changed

+80
-110
lines changed

2 files changed

+80
-110
lines changed

docs/_templates/layout.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends "!layout.html" %}
2+
3+
{% block footer %}
4+
{{ super() }}
5+
<!-- Google tag (gtag.js) -->
6+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2EW85FTY8C"></script>
7+
<script>
8+
window.dataLayer = window.dataLayer || [];
9+
function gtag(){dataLayer.push(arguments);}
10+
gtag('js', new Date());
11+
12+
gtag('config', 'G-2EW85FTY8C');
13+
</script>
14+
{% endblock %}

docs/user_guide/getting_started_01.ipynb

Lines changed: 66 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"outputs": [],
3838
"source": [
3939
"import numpy as np\n",
40-
"from pprint import pprint\n",
40+
"from jupyterutils import table_print\n",
4141
"\n",
4242
"data = [\n",
4343
" {'user': 'john', 'age': 1, 'job': 'engineer', 'credit_score': 'high'},\n",
@@ -53,7 +53,9 @@
5353
"source": [
5454
"This will make up 3 entries in Redis (hashes) each with 4 sub-keys (users, age, job, credit_score).\n",
5555
"\n",
56-
"Now, we want to add vectors to represent each user. These are just dummy vectors to illustrate the point, but more complex vectors can be created and used as well. For more information on creating embeddings, see this [article](https://mlops.community/vector-similarity-search-from-basics-to-production/).\n"
56+
"Now, we want to add vectors to represent each user. These are just dummy vectors to illustrate the point, but more complex vectors can be created and used as well. For more information on creating embeddings, see this [article](https://mlops.community/vector-similarity-search-from-basics-to-production/).\n",
57+
"\n",
58+
"As seen below, the sample vectors need to be turned into bytes before they can be loaded into Redis. Using ``NumPy``, this is fairly trivial."
5759
]
5860
},
5961
{
@@ -62,25 +64,16 @@
6264
"metadata": {},
6365
"outputs": [
6466
{
65-
"name": "stdout",
66-
"output_type": "stream",
67-
"text": [
68-
"[{'age': 1,\n",
69-
" 'credit_score': 'high',\n",
70-
" 'job': 'engineer',\n",
71-
" 'user': 'john',\n",
72-
" 'user_embedding': b'\\xcd\\xcc\\xcc=\\xcd\\xcc\\xcc=\\x00\\x00\\x00?'},\n",
73-
" {'age': 2,\n",
74-
" 'credit_score': 'low',\n",
75-
" 'job': 'doctor',\n",
76-
" 'user': 'mary',\n",
77-
" 'user_embedding': b'\\xcd\\xcc\\xcc=\\xcd\\xcc\\xcc=\\x00\\x00\\x00?'},\n",
78-
" {'age': 3,\n",
79-
" 'credit_score': 'medium',\n",
80-
" 'job': 'dentist',\n",
81-
" 'user': 'joe',\n",
82-
" 'user_embedding': b'fff?fff?\\xcd\\xcc\\xcc='}]\n"
83-
]
67+
"data": {
68+
"text/html": [
69+
"<table><tr><th>user</th><th>age</th><th>job</th><th>credit_score</th><th>user_embedding</th></tr><tr><td>john</td><td>1</td><td>engineer</td><td>high</td><td>b'\\xcd\\xcc\\xcc=\\xcd\\xcc\\xcc=\\x00\\x00\\x00?'</td></tr><tr><td>mary</td><td>2</td><td>doctor</td><td>low</td><td>b'\\xcd\\xcc\\xcc=\\xcd\\xcc\\xcc=\\x00\\x00\\x00?'</td></tr><tr><td>joe</td><td>3</td><td>dentist</td><td>medium</td><td>b'fff?fff?\\xcd\\xcc\\xcc='</td></tr></table>"
70+
],
71+
"text/plain": [
72+
"<IPython.core.display.HTML object>"
73+
]
74+
},
75+
"metadata": {},
76+
"output_type": "display_data"
8477
}
8578
],
8679
"source": [
@@ -94,17 +87,16 @@
9487
"for record, vector in zip(data, vectors):\n",
9588
" record[\"user_embedding\"] = vector\n",
9689
"\n",
97-
"pprint(data)"
90+
"table_print(data)"
9891
]
9992
},
10093
{
10194
"attachments": {},
10295
"cell_type": "markdown",
10396
"metadata": {},
10497
"source": [
105-
"As seen above, the vectors themselves need to be turned into bytes before they can be loaded into Redis. Using ``NumPy``, this is fairly trivial. \n",
10698
"\n",
107-
"Our dataset is now ready to be used with ``redisvl``"
99+
"Our dataset is now ready to be used with ``redisvl``. The next step is to define the schema for the data."
108100
]
109101
},
110102
{
@@ -146,9 +138,8 @@
146138
" # define vector fields\n",
147139
" vector:\n",
148140
" - name: user_embedding\n",
149-
" algorithm: hnsw\n",
150-
" distance_metric: cosine\n",
151-
"\n",
141+
" algorithm: hnsw\n",
142+
" distance_metric: cosine\n",
152143
"\n",
153144
"```\n",
154145
"\n",
@@ -213,15 +204,15 @@
213204
},
214205
{
215206
"cell_type": "code",
216-
"execution_count": 6,
207+
"execution_count": 5,
217208
"metadata": {},
218209
"outputs": [
219210
{
220211
"name": "stdout",
221212
"output_type": "stream",
222213
"text": [
223-
"\u001b[32m16:42:28\u001b[0m \u001b[35msam.partee-NW9MQX5Y74\u001b[0m \u001b[34mredisvl.cli.index[4009]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
224-
"\u001b[32m16:42:28\u001b[0m \u001b[35msam.partee-NW9MQX5Y74\u001b[0m \u001b[34mredisvl.cli.index[4009]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. user_index\n"
214+
"\u001b[32m13:15:04\u001b[0m \u001b[35msam.partee-NW9MQX5Y74\u001b[0m \u001b[34mredisvl.cli.index[13683]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
215+
"\u001b[32m13:15:04\u001b[0m \u001b[35msam.partee-NW9MQX5Y74\u001b[0m \u001b[34mredisvl.cli.index[13683]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. user_index\n"
225216
]
226217
}
227218
],
@@ -241,7 +232,7 @@
241232
},
242233
{
243234
"cell_type": "code",
244-
"execution_count": 7,
235+
"execution_count": 6,
245236
"metadata": {},
246237
"outputs": [],
247238
"source": [
@@ -261,11 +252,25 @@
261252
},
262253
{
263254
"cell_type": "code",
264-
"execution_count": 8,
255+
"execution_count": 7,
265256
"metadata": {},
266-
"outputs": [],
257+
"outputs": [
258+
{
259+
"data": {
260+
"text/html": [
261+
"<table><tr><th>vector_distance</th><th>user</th><th>age</th><th>job</th><th>credit_score</th></tr><tr><td>0</td><td>john</td><td>1</td><td>engineer</td><td>high</td></tr><tr><td>0</td><td>mary</td><td>2</td><td>doctor</td><td>low</td></tr><tr><td>0.653301358223</td><td>joe</td><td>3</td><td>dentist</td><td>medium</td></tr></table>"
262+
],
263+
"text/plain": [
264+
"<IPython.core.display.HTML object>"
265+
]
266+
},
267+
"metadata": {},
268+
"output_type": "display_data"
269+
}
270+
],
267271
"source": [
268272
"from redisvl.query import VectorQuery\n",
273+
"from jupyterutils import result_print\n",
269274
"\n",
270275
"# create a vector query returning a number of results\n",
271276
"# with specific fields to return.\n",
@@ -277,31 +282,8 @@
277282
")\n",
278283
"\n",
279284
"# use the SearchIndex instance (or Redis client) to execute the query\n",
280-
"results = index.query(query)"
281-
]
282-
},
283-
{
284-
"cell_type": "code",
285-
"execution_count": 10,
286-
"metadata": {},
287-
"outputs": [
288-
{
289-
"name": "stdout",
290-
"output_type": "stream",
291-
"text": [
292-
"Score: 0\n",
293-
"Document {'id': 'v1:john', 'payload': None, 'vector_distance': '0', 'user': 'john', 'age': '1', 'job': 'engineer', 'credit_score': 'high'}\n",
294-
"Score: 0\n",
295-
"Document {'id': 'v1:mary', 'payload': None, 'vector_distance': '0', 'user': 'mary', 'age': '2', 'job': 'doctor', 'credit_score': 'low'}\n",
296-
"Score: 0.653301358223\n",
297-
"Document {'id': 'v1:joe', 'payload': None, 'vector_distance': '0.653301358223', 'user': 'joe', 'age': '3', 'job': 'dentist', 'credit_score': 'medium'}\n"
298-
]
299-
}
300-
],
301-
"source": [
302-
"for doc in results.docs:\n",
303-
" print(\"Score:\", doc.vector_distance)\n",
304-
" print(doc)\n"
285+
"results = index.query(query)\n",
286+
"result_print(results)"
305287
]
306288
},
307289
{
@@ -315,44 +297,29 @@
315297
},
316298
{
317299
"cell_type": "code",
318-
"execution_count": 11,
300+
"execution_count": 8,
319301
"metadata": {},
320302
"outputs": [
321303
{
322-
"ename": "ResponseError",
323-
"evalue": "Unknown Index name",
324-
"output_type": "error",
325-
"traceback": [
326-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
327-
"\u001b[0;31mResponseError\u001b[0m Traceback (most recent call last)",
328-
"Cell \u001b[0;32mIn[11], line 7\u001b[0m\n\u001b[1;32m 4\u001b[0m redis_client \u001b[39m=\u001b[39m Redis(\u001b[39m\"\u001b[39m\u001b[39mlocalhost\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m6379\u001b[39m)\n\u001b[1;32m 6\u001b[0m \u001b[39m# create a new SearchIndex instance from an existing index\u001b[39;00m\n\u001b[0;32m----> 7\u001b[0m existing_index \u001b[39m=\u001b[39m SearchIndex\u001b[39m.\u001b[39;49mfrom_existing(redis_client, \u001b[39m\"\u001b[39;49m\u001b[39muser_index\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n\u001b[1;32m 9\u001b[0m \u001b[39m# run the same query\u001b[39;00m\n\u001b[1;32m 10\u001b[0m existing_index\u001b[39m.\u001b[39mquery(query)\n",
329-
"File \u001b[0;32m~/Dropbox/Redis/data-loader/redisvl/index.py:107\u001b[0m, in \u001b[0;36mfrom_existing\u001b[0;34m(cls, client, index_name)\u001b[0m\n\u001b[1;32m 103\u001b[0m @classmethod\n\u001b[1;32m 104\u001b[0m def from_existing(cls, client: redis.Redis, index_name: str):\n\u001b[1;32m 105\u001b[0m \"\"\"Create a SearchIndex from an existing index in Redis\"\"\"\n\u001b[1;32m 106\u001b[0m # TODO assert client connected\n\u001b[0;32m--> 107\u001b[0m # TODO try/except\n\u001b[1;32m 108\u001b[0m info = convert_bytes(client.ft(index_name).info()) # TODO catch response error\n\u001b[1;32m 109\u001b[0m index_definition = make_dict(info[\"index_definition\"])\n",
330-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/commands/search/commands.py:370\u001b[0m, in \u001b[0;36mSearchCommands.info\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 362\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39minfo\u001b[39m(\u001b[39mself\u001b[39m):\n\u001b[1;32m 363\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 364\u001b[0m \u001b[39m Get info an stats about the the current index, including the number of\u001b[39;00m\n\u001b[1;32m 365\u001b[0m \u001b[39m documents, memory consumption, etc\u001b[39;00m\n\u001b[1;32m 366\u001b[0m \n\u001b[1;32m 367\u001b[0m \u001b[39m For more information see `FT.INFO <https://redis.io/commands/ft.info>`_.\u001b[39;00m\n\u001b[1;32m 368\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 370\u001b[0m res \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mexecute_command(INFO_CMD, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mindex_name)\n\u001b[1;32m 371\u001b[0m it \u001b[39m=\u001b[39m \u001b[39mmap\u001b[39m(to_string, res)\n\u001b[1;32m 372\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mdict\u001b[39m(\u001b[39mzip\u001b[39m(it, it))\n",
331-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/client.py:1269\u001b[0m, in \u001b[0;36mRedis.execute_command\u001b[0;34m(self, *args, **options)\u001b[0m\n\u001b[1;32m 1266\u001b[0m conn \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconnection \u001b[39mor\u001b[39;00m pool\u001b[39m.\u001b[39mget_connection(command_name, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39moptions)\n\u001b[1;32m 1268\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m-> 1269\u001b[0m \u001b[39mreturn\u001b[39;00m conn\u001b[39m.\u001b[39;49mretry\u001b[39m.\u001b[39;49mcall_with_retry(\n\u001b[1;32m 1270\u001b[0m \u001b[39mlambda\u001b[39;49;00m: \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_send_command_parse_response(\n\u001b[1;32m 1271\u001b[0m conn, command_name, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49moptions\n\u001b[1;32m 1272\u001b[0m ),\n\u001b[1;32m 1273\u001b[0m \u001b[39mlambda\u001b[39;49;00m error: \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_disconnect_raise(conn, error),\n\u001b[1;32m 1274\u001b[0m )\n\u001b[1;32m 1275\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 1276\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconnection:\n",
332-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/retry.py:46\u001b[0m, in \u001b[0;36mRetry.call_with_retry\u001b[0;34m(self, do, fail)\u001b[0m\n\u001b[1;32m 44\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mTrue\u001b[39;00m:\n\u001b[1;32m 45\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m---> 46\u001b[0m \u001b[39mreturn\u001b[39;00m do()\n\u001b[1;32m 47\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_supported_errors \u001b[39mas\u001b[39;00m error:\n\u001b[1;32m 48\u001b[0m failures \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
333-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/client.py:1270\u001b[0m, in \u001b[0;36mRedis.execute_command.<locals>.<lambda>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1266\u001b[0m conn \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconnection \u001b[39mor\u001b[39;00m pool\u001b[39m.\u001b[39mget_connection(command_name, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39moptions)\n\u001b[1;32m 1268\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 1269\u001b[0m \u001b[39mreturn\u001b[39;00m conn\u001b[39m.\u001b[39mretry\u001b[39m.\u001b[39mcall_with_retry(\n\u001b[0;32m-> 1270\u001b[0m \u001b[39mlambda\u001b[39;00m: \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_send_command_parse_response(\n\u001b[1;32m 1271\u001b[0m conn, command_name, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49moptions\n\u001b[1;32m 1272\u001b[0m ),\n\u001b[1;32m 1273\u001b[0m \u001b[39mlambda\u001b[39;00m error: \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_disconnect_raise(conn, error),\n\u001b[1;32m 1274\u001b[0m )\n\u001b[1;32m 1275\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 1276\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconnection:\n",
334-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/client.py:1246\u001b[0m, in \u001b[0;36mRedis._send_command_parse_response\u001b[0;34m(self, conn, command_name, *args, **options)\u001b[0m\n\u001b[1;32m 1242\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1243\u001b[0m \u001b[39mSend a command and parse the response\u001b[39;00m\n\u001b[1;32m 1244\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1245\u001b[0m conn\u001b[39m.\u001b[39msend_command(\u001b[39m*\u001b[39margs)\n\u001b[0;32m-> 1246\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mparse_response(conn, command_name, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49moptions)\n",
335-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/client.py:1286\u001b[0m, in \u001b[0;36mRedis.parse_response\u001b[0;34m(self, connection, command_name, **options)\u001b[0m\n\u001b[1;32m 1284\u001b[0m options\u001b[39m.\u001b[39mpop(NEVER_DECODE)\n\u001b[1;32m 1285\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m-> 1286\u001b[0m response \u001b[39m=\u001b[39m connection\u001b[39m.\u001b[39;49mread_response()\n\u001b[1;32m 1287\u001b[0m \u001b[39mexcept\u001b[39;00m ResponseError:\n\u001b[1;32m 1288\u001b[0m \u001b[39mif\u001b[39;00m EMPTY_RESPONSE \u001b[39min\u001b[39;00m options:\n",
336-
"File \u001b[0;32m~/.virtualenvs/rvl/lib/python3.8/site-packages/redis/connection.py:905\u001b[0m, in \u001b[0;36mAbstractConnection.read_response\u001b[0;34m(self, disable_decoding, disconnect_on_error)\u001b[0m\n\u001b[1;32m 902\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mnext_health_check \u001b[39m=\u001b[39m time() \u001b[39m+\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhealth_check_interval\n\u001b[1;32m 904\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(response, ResponseError):\n\u001b[0;32m--> 905\u001b[0m \u001b[39mraise\u001b[39;00m response\n\u001b[1;32m 906\u001b[0m \u001b[39mreturn\u001b[39;00m response\n",
337-
"\u001b[0;31mResponseError\u001b[0m: Unknown Index name"
338-
]
304+
"data": {
305+
"text/html": [
306+
"<table><tr><th>vector_distance</th><th>user</th><th>age</th><th>job</th><th>credit_score</th></tr><tr><td>0</td><td>john</td><td>1</td><td>engineer</td><td>high</td></tr><tr><td>0</td><td>mary</td><td>2</td><td>doctor</td><td>low</td></tr><tr><td>0.653301358223</td><td>joe</td><td>3</td><td>dentist</td><td>medium</td></tr></table>"
307+
],
308+
"text/plain": [
309+
"<IPython.core.display.HTML object>"
310+
]
311+
},
312+
"metadata": {},
313+
"output_type": "display_data"
339314
}
340315
],
341316
"source": [
342-
"from redis import Redis\n",
343-
"\n",
344-
"# initialize a redis client to connect to existing index\n",
345-
"redis_client = Redis(\"localhost\", 6379)\n",
346-
"\n",
347317
"# create a new SearchIndex instance from an existing index\n",
348-
"existing_index = SearchIndex.from_existing(redis_client, \"user_index\")\n",
318+
"existing_index = SearchIndex.from_existing(\"user_index\", \"redis://localhost:6379\")\n",
349319
"\n",
350320
"# run the same query\n",
351-
"existing_index.query(query)\n",
352-
"\n",
353-
"for doc in results.docs:\n",
354-
" print(\"Score:\", doc.vector_distance)\n",
355-
" print(doc)"
321+
"results = existing_index.query(query)\n",
322+
"result_print(results)\n"
356323
]
357324
},
358325
{
@@ -366,25 +333,24 @@
366333
},
367334
{
368335
"cell_type": "code",
369-
"execution_count": 12,
336+
"execution_count": 10,
370337
"metadata": {},
371338
"outputs": [
372339
{
373-
"name": "stdout",
374-
"output_type": "stream",
375-
"text": [
376-
"Score: 0\n",
377-
"Document {'id': 'v1:john', 'payload': None, 'vector_distance': '0', 'user': 'john', 'age': '1', 'job': 'engineer', 'credit_score': 'high'}\n",
378-
"Score: 0\n",
379-
"Document {'id': 'v1:mary', 'payload': None, 'vector_distance': '0', 'user': 'mary', 'age': '2', 'job': 'doctor', 'credit_score': 'low'}\n",
380-
"Score: 0.653301358223\n",
381-
"Document {'id': 'v1:joe', 'payload': None, 'vector_distance': '0.653301358223', 'user': 'joe', 'age': '3', 'job': 'dentist', 'credit_score': 'medium'}\n"
382-
]
340+
"data": {
341+
"text/html": [
342+
"<table><tr><th>vector_distance</th><th>user</th><th>age</th><th>job</th><th>credit_score</th></tr><tr><td>0</td><td>john</td><td>1</td><td>engineer</td><td>high</td></tr><tr><td>0</td><td>mary</td><td>2</td><td>doctor</td><td>low</td></tr><tr><td>0.653301358223</td><td>joe</td><td>3</td><td>dentist</td><td>medium</td></tr></table>"
343+
],
344+
"text/plain": [
345+
"<IPython.core.display.HTML object>"
346+
]
347+
},
348+
"metadata": {},
349+
"output_type": "display_data"
383350
}
384351
],
385352
"source": [
386353
"## Asynchronous Search\n",
387-
"\n",
388354
"from redisvl.index import AsyncSearchIndex\n",
389355
"\n",
390356
"# construct a search index from the schema\n",
@@ -401,18 +367,8 @@
401367
"\n",
402368
"# run the same vector query but asynchronously\n",
403369
"results = await index.query(query)\n",
404-
"\n",
405-
"for doc in results.docs:\n",
406-
" print(\"Score:\", doc.vector_distance)\n",
407-
" print(doc)"
370+
"result_print(results)"
408371
]
409-
},
410-
{
411-
"cell_type": "code",
412-
"execution_count": null,
413-
"metadata": {},
414-
"outputs": [],
415-
"source": []
416372
}
417373
],
418374
"metadata": {

0 commit comments

Comments
 (0)