Skip to content

Commit 1ac4894

Browse files
committed
refactor timestamp to extend num
1 parent 8b020fc commit 1ac4894

File tree

4 files changed

+181
-388
lines changed

4 files changed

+181
-388
lines changed

docs/user_guide/02_hybrid_queries.ipynb

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 6,
19+
"execution_count": 1,
2020
"metadata": {},
2121
"outputs": [
2222
{
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"cell_type": "code",
46-
"execution_count": 1,
46+
"execution_count": 2,
4747
"metadata": {},
4848
"outputs": [],
4949
"source": [
@@ -77,14 +77,14 @@
7777
},
7878
{
7979
"cell_type": "code",
80-
"execution_count": 2,
80+
"execution_count": 3,
8181
"metadata": {},
8282
"outputs": [
8383
{
8484
"name": "stdout",
8585
"output_type": "stream",
8686
"text": [
87-
"13:53:37 redisvl.index.index INFO Index already exists, overwriting.\n"
87+
"11:40:25 redisvl.index.index INFO Index already exists, overwriting.\n"
8888
]
8989
}
9090
],
@@ -100,15 +100,23 @@
100100
},
101101
{
102102
"cell_type": "code",
103-
"execution_count": 3,
103+
"execution_count": 27,
104104
"metadata": {},
105105
"outputs": [
106106
{
107107
"name": "stdout",
108108
"output_type": "stream",
109109
"text": [
110-
"\u001b[32m13:53:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
111-
"\u001b[32m13:53:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. user_queries\n"
110+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n",
111+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. float64_session\n",
112+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 2. float64_cache\n",
113+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 3. float16_cache\n",
114+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 4. float32_session\n",
115+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 5. float16_session\n",
116+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 6. bfloat_session\n",
117+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 7. float32_cache\n",
118+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 8. bfloat_cache\n",
119+
"\u001b[32m11:03:03\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 9. user_queries\n"
112120
]
113121
}
114122
],
@@ -119,7 +127,7 @@
119127
},
120128
{
121129
"cell_type": "code",
122-
"execution_count": 8,
130+
"execution_count": 28,
123131
"metadata": {},
124132
"outputs": [],
125133
"source": [
@@ -168,7 +176,7 @@
168176
},
169177
{
170178
"cell_type": "code",
171-
"execution_count": 21,
179+
"execution_count": 5,
172180
"metadata": {},
173181
"outputs": [
174182
{
@@ -203,13 +211,13 @@
203211
},
204212
{
205213
"cell_type": "code",
206-
"execution_count": 7,
214+
"execution_count": 6,
207215
"metadata": {},
208216
"outputs": [
209217
{
210218
"data": {
211219
"text/html": [
212-
"<table><tr><th>vector_distance</th><th>user</th><th>credit_score</th><th>age</th><th>job</th><th>office_location</th></tr><tr><td>0</td><td>derrick</td><td>low</td><td>14</td><td>doctor</td><td>-122.4194,37.7749</td></tr><tr><td>0</td><td>derrick</td><td>low</td><td>14</td><td>doctor</td><td>-122.4194,37.7749</td></tr><tr><td>0.217882037163</td><td>taimur</td><td>low</td><td>15</td><td>CEO</td><td>-122.0839,37.3861</td></tr><tr><td>0.217882037163</td><td>taimur</td><td>low</td><td>15</td><td>CEO</td><td>-122.0839,37.3861</td></tr><tr><td>0.653301358223</td><td>joe</td><td>medium</td><td>35</td><td>dentist</td><td>-122.0839,37.3861</td></tr><tr><td>0.653301358223</td><td>joe</td><td>medium</td><td>35</td><td>dentist</td><td>-122.0839,37.3861</td></tr></table>"
220+
"<table><tr><th>vector_distance</th><th>user</th><th>credit_score</th><th>age</th><th>job</th><th>office_location</th><th>last_updated</th></tr><tr><td>0</td><td>derrick</td><td>low</td><td>14</td><td>doctor</td><td>-122.4194,37.7749</td><td>1741627789</td></tr><tr><td>0.217882037163</td><td>taimur</td><td>low</td><td>15</td><td>CEO</td><td>-122.0839,37.3861</td><td>1742232589</td></tr><tr><td>0.653301358223</td><td>joe</td><td>medium</td><td>35</td><td>dentist</td><td>-122.0839,37.3861</td><td>1742232589</td></tr></table>"
213221
],
214222
"text/plain": [
215223
"<IPython.core.display.HTML object>"
@@ -327,13 +335,13 @@
327335
},
328336
{
329337
"cell_type": "code",
330-
"execution_count": 20,
338+
"execution_count": 6,
331339
"metadata": {},
332340
"outputs": [
333341
{
334342
"data": {
335343
"text/html": [
336-
"<table><tr><th>vector_distance</th><th>user</th><th>credit_score</th><th>age</th><th>job</th><th>office_location</th><th>last_updated</th></tr><tr><td>0</td><td>john</td><td>high</td><td>18</td><td>engineer</td><td>-122.4194,37.7749</td><td>1741627789</td></tr><tr><td>0.109129190445</td><td>tyler</td><td>high</td><td>100</td><td>engineer</td><td>-122.0839,37.3861</td><td>1742232589</td></tr><tr><td>0.266666650772</td><td>nancy</td><td>high</td><td>94</td><td>doctor</td><td>-122.4194,37.7749</td><td>1710696589</td></tr><tr><td>0.653301358223</td><td>joe</td><td>medium</td><td>35</td><td>dentist</td><td>-122.0839,37.3861</td><td>1742232589</td></tr></table>"
344+
"<table><tr><th>vector_distance</th><th>user</th><th>credit_score</th><th>age</th><th>job</th><th>office_location</th><th>last_updated</th></tr><tr><td>0</td><td>john</td><td>high</td><td>18</td><td>engineer</td><td>-122.4194,37.7749</td><td>1741627789</td></tr><tr><td>0.217882037163</td><td>taimur</td><td>low</td><td>15</td><td>CEO</td><td>-122.0839,37.3861</td><td>1742232589</td></tr><tr><td>0.653301358223</td><td>joe</td><td>medium</td><td>35</td><td>dentist</td><td>-122.0839,37.3861</td><td>1742232589</td></tr></table>"
337345
],
338346
"text/plain": [
339347
"<IPython.core.display.HTML object>"
@@ -346,7 +354,7 @@
346354
"source": [
347355
"from redisvl.query.filter import Num\n",
348356
"\n",
349-
"numeric_filter = Num(\"age\") > 15\n",
357+
"numeric_filter = Num(\"age\").between(15, 35)\n",
350358
"\n",
351359
"v.set_filter(numeric_filter)\n",
352360
"result_print(index.query(v))"

0 commit comments

Comments
 (0)