|
17 | 17 | },
|
18 | 18 | {
|
19 | 19 | "cell_type": "code",
|
20 |
| - "execution_count": 1, |
| 20 | + "execution_count": 30, |
21 | 21 | "metadata": {},
|
22 | 22 | "outputs": [
|
23 | 23 | {
|
24 | 24 | "name": "stdout",
|
25 | 25 | "output_type": "stream",
|
26 | 26 | "text": [
|
27 |
| - "\u001b[32m15:02:39\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m RedisVL version 0.3.9\n" |
| 27 | + "\u001b[32m18:12:25\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m RedisVL version 0.3.9\n" |
28 | 28 | ]
|
29 | 29 | }
|
30 | 30 | ],
|
|
33 | 33 | "!rvl version"
|
34 | 34 | ]
|
35 | 35 | },
|
| 36 | + { |
| 37 | + "cell_type": "markdown", |
| 38 | + "metadata": {}, |
| 39 | + "source": [ |
| 40 | + "## Commands\n", |
| 41 | + "Here's a table of all the rvl commands and options. We'll go into each one in detail below.\n", |
| 42 | + "\n", |
| 43 | + "| Command | Options | Description |\n", |
| 44 | + "|---------------|--------------------------|-------------|\n", |
| 45 | + "| `rvl version` | | display the redisvl library version|\n", |
| 46 | + "| `rvl index` | `create --schema` or `-s <schema.yaml>`| create a redis index from the specified schema file|\n", |
| 47 | + "| `rvl index` | `listall` | list all the existing search indices|\n", |
| 48 | + "| `rvl index` | `info --index` or ` -i <index_name>` | display the index definition in tabular format|\n", |
| 49 | + "| `rvl index` | `delete --index` or `-i <index_name>` | remove the specified index, leaving the data still in Redis|\n", |
| 50 | + "| `rvl index` | `destroy --index` or `-i <index_name>`| remove the specified index, as well as the associated data|\n", |
| 51 | + "| `rvl stats` | `--index` or `-i <index_name>` | display the index statistics, including number of docs, average bytes per record, indexing time, etc|\n", |
| 52 | + "| `rvl stats` | `--schema` or `-s <schema.yaml>` | display the index statistics of a schema defined in <schema.yaml>. The index must have already been created within Redis|" |
| 53 | + ] |
| 54 | + }, |
36 | 55 | {
|
37 | 56 | "cell_type": "markdown",
|
38 | 57 | "metadata": {},
|
|
46 | 65 | },
|
47 | 66 | {
|
48 | 67 | "cell_type": "code",
|
49 |
| - "execution_count": 2, |
| 68 | + "execution_count": 31, |
50 | 69 | "metadata": {},
|
51 | 70 | "outputs": [
|
52 | 71 | {
|
|
80 | 99 | },
|
81 | 100 | {
|
82 | 101 | "cell_type": "code",
|
83 |
| - "execution_count": 3, |
| 102 | + "execution_count": 32, |
84 | 103 | "metadata": {},
|
85 | 104 | "outputs": [
|
86 | 105 | {
|
87 | 106 | "name": "stdout",
|
88 | 107 | "output_type": "stream",
|
89 | 108 | "text": [
|
90 |
| - "\u001b[32m22:33:31\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n" |
| 109 | + "\u001b[32m18:12:32\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 110 | + "\u001b[32m18:12:32\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n" |
91 | 111 | ]
|
92 | 112 | }
|
93 | 113 | ],
|
|
98 | 118 | },
|
99 | 119 | {
|
100 | 120 | "cell_type": "code",
|
101 |
| - "execution_count": 4, |
| 121 | + "execution_count": 33, |
102 | 122 | "metadata": {},
|
103 | 123 | "outputs": [
|
104 | 124 | {
|
105 | 125 | "name": "stdout",
|
106 | 126 | "output_type": "stream",
|
107 | 127 | "text": [
|
108 |
| - "\u001b[32m22:33:33\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n", |
109 |
| - "\u001b[32m22:33:33\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n" |
| 128 | + "\u001b[32m18:12:35\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 129 | + "\u001b[32m18:12:35\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n", |
| 130 | + "\u001b[32m18:12:35\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n" |
110 | 131 | ]
|
111 | 132 | }
|
112 | 133 | ],
|
|
117 | 138 | },
|
118 | 139 | {
|
119 | 140 | "cell_type": "code",
|
120 |
| - "execution_count": 5, |
| 141 | + "execution_count": 34, |
121 | 142 | "metadata": {},
|
122 | 143 | "outputs": [
|
123 | 144 | {
|
124 | 145 | "name": "stdout",
|
125 | 146 | "output_type": "stream",
|
126 | 147 | "text": [
|
| 148 | + "\u001b[32m18:12:37\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
127 | 149 | "\n",
|
128 | 150 | "\n",
|
129 | 151 | "Index Information:\n",
|
|
149 | 171 | },
|
150 | 172 | {
|
151 | 173 | "cell_type": "code",
|
152 |
| - "execution_count": 6, |
| 174 | + "execution_count": 35, |
153 | 175 | "metadata": {},
|
154 | 176 | "outputs": [
|
155 | 177 | {
|
156 | 178 | "name": "stdout",
|
157 | 179 | "output_type": "stream",
|
158 | 180 | "text": [
|
159 |
| - "\u001b[32m22:33:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n" |
| 181 | + "\u001b[32m18:12:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 182 | + "\u001b[32m18:12:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n" |
160 | 183 | ]
|
161 | 184 | }
|
162 | 185 | ],
|
|
167 | 190 | },
|
168 | 191 | {
|
169 | 192 | "cell_type": "code",
|
170 |
| - "execution_count": 7, |
| 193 | + "execution_count": 36, |
171 | 194 | "metadata": {},
|
172 | 195 | "outputs": [
|
173 | 196 | {
|
174 | 197 | "name": "stdout",
|
175 | 198 | "output_type": "stream",
|
176 | 199 | "text": [
|
177 |
| - "\u001b[32m22:33:37\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n" |
| 200 | + "\u001b[32m18:12:43\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 201 | + "\u001b[32m18:12:43\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n" |
178 | 202 | ]
|
179 | 203 | }
|
180 | 204 | ],
|
181 | 205 | "source": [
|
182 |
| - "# see the index\n", |
| 206 | + "# see the indices that still exist\n", |
183 | 207 | "!rvl index listall"
|
184 | 208 | ]
|
185 | 209 | },
|
|
194 | 218 | },
|
195 | 219 | {
|
196 | 220 | "cell_type": "code",
|
197 |
| - "execution_count": 8, |
| 221 | + "execution_count": 38, |
198 | 222 | "metadata": {},
|
199 | 223 | "outputs": [
|
200 | 224 | {
|
201 | 225 | "name": "stdout",
|
202 | 226 | "output_type": "stream",
|
203 | 227 | "text": [
|
204 |
| - "\u001b[32m22:33:40\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n" |
| 228 | + "\u001b[32m18:13:21\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 229 | + "\u001b[32m18:13:21\u001b[0m \u001b[34mredisvl.index.index\u001b[0m \u001b[1;30mINFO\u001b[0m Index already exists, not overwriting.\n", |
| 230 | + "\u001b[32m18:13:21\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index created successfully\n" |
205 | 231 | ]
|
206 | 232 | }
|
207 | 233 | ],
|
208 | 234 | "source": [
|
209 | 235 | "# create a new index with the same schema\n",
|
| 236 | + "# recreating the index will reindex the documents\n", |
210 | 237 | "!rvl index create -s schema.yaml"
|
211 | 238 | ]
|
212 | 239 | },
|
213 | 240 | {
|
214 | 241 | "cell_type": "code",
|
215 |
| - "execution_count": 9, |
| 242 | + "execution_count": 39, |
216 | 243 | "metadata": {},
|
217 | 244 | "outputs": [
|
218 | 245 | {
|
219 | 246 | "name": "stdout",
|
220 | 247 | "output_type": "stream",
|
221 | 248 | "text": [
|
222 |
| - "\u001b[32m22:33:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n", |
223 |
| - "\u001b[32m22:33:42\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n" |
| 249 | + "\u001b[32m18:13:25\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 250 | + "\u001b[32m18:13:25\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n", |
| 251 | + "\u001b[32m18:13:25\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n" |
224 | 252 | ]
|
225 | 253 | }
|
226 | 254 | ],
|
|
231 | 259 | },
|
232 | 260 | {
|
233 | 261 | "cell_type": "code",
|
234 |
| - "execution_count": 10, |
| 262 | + "execution_count": 40, |
235 | 263 | "metadata": {},
|
236 | 264 | "outputs": [
|
237 | 265 | {
|
238 | 266 | "name": "stdout",
|
239 | 267 | "output_type": "stream",
|
240 | 268 | "text": [
|
| 269 | + "\u001b[32m18:13:31\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
241 | 270 | "\n",
|
242 | 271 | "Statistics:\n",
|
243 |
| - "╭─────────────────────────────┬────────────╮\n", |
244 |
| - "│ Stat Key │ Value │\n", |
245 |
| - "├─────────────────────────────┼────────────┤\n", |
246 |
| - "│ num_docs │ 0 │\n", |
247 |
| - "│ num_terms │ 0 │\n", |
248 |
| - "│ max_doc_id │ 0 │\n", |
249 |
| - "│ num_records │ 0 │\n", |
250 |
| - "│ percent_indexed │ 1 │\n", |
251 |
| - "│ hash_indexing_failures │ 0 │\n", |
252 |
| - "│ number_of_uses │ 1 │\n", |
253 |
| - "│ bytes_per_record_avg │ nan │\n", |
254 |
| - "│ doc_table_size_mb │ 0 │\n", |
255 |
| - "│ inverted_sz_mb │ 0 │\n", |
256 |
| - "│ key_table_size_mb │ 0 │\n", |
257 |
| - "│ offset_bits_per_record_avg │ nan │\n", |
258 |
| - "│ offset_vectors_sz_mb │ 0 │\n", |
259 |
| - "│ offsets_per_term_avg │ nan │\n", |
260 |
| - "│ records_per_doc_avg │ nan │\n", |
261 |
| - "│ sortable_values_size_mb │ 0 │\n", |
262 |
| - "│ total_indexing_time │ 0 │\n", |
263 |
| - "│ total_inverted_index_blocks │ 0 │\n", |
264 |
| - "│ vector_index_sz_mb │ 0.00818634 │\n", |
265 |
| - "╰─────────────────────────────┴────────────╯\n" |
| 272 | + "╭─────────────────────────────┬─────────╮\n", |
| 273 | + "│ Stat Key │ Value │\n", |
| 274 | + "├─────────────────────────────┼─────────┤\n", |
| 275 | + "│ num_docs │ 0 │\n", |
| 276 | + "│ num_terms │ 0 │\n", |
| 277 | + "│ max_doc_id │ 0 │\n", |
| 278 | + "│ num_records │ 0 │\n", |
| 279 | + "│ percent_indexed │ 1 │\n", |
| 280 | + "│ hash_indexing_failures │ 3 │\n", |
| 281 | + "│ number_of_uses │ 2 │\n", |
| 282 | + "│ bytes_per_record_avg │ nan │\n", |
| 283 | + "│ doc_table_size_mb │ 0 │\n", |
| 284 | + "│ inverted_sz_mb │ 0 │\n", |
| 285 | + "│ key_table_size_mb │ 0 │\n", |
| 286 | + "│ offset_bits_per_record_avg │ nan │\n", |
| 287 | + "│ offset_vectors_sz_mb │ 0 │\n", |
| 288 | + "│ offsets_per_term_avg │ nan │\n", |
| 289 | + "│ records_per_doc_avg │ nan │\n", |
| 290 | + "│ sortable_values_size_mb │ 0 │\n", |
| 291 | + "│ total_indexing_time │ 0.02 │\n", |
| 292 | + "│ total_inverted_index_blocks │ 0 │\n", |
| 293 | + "│ vector_index_sz_mb │ 0 │\n", |
| 294 | + "╰─────────────────────────────┴─────────╯\n" |
266 | 295 | ]
|
267 | 296 | }
|
268 | 297 | ],
|
|
271 | 300 | "!rvl stats -i vectorizers"
|
272 | 301 | ]
|
273 | 302 | },
|
| 303 | + { |
| 304 | + "cell_type": "markdown", |
| 305 | + "metadata": {}, |
| 306 | + "source": [ |
| 307 | + "## Optional arguments\n", |
| 308 | + "You can modify these commands with the below optional arguments\n", |
| 309 | + "\n", |
| 310 | + "| Argument | Description | Default |\n", |
| 311 | + "|----------------|-------------|---------|\n", |
| 312 | + "| `-u --url` | The full Redis URL to connec to | `redis://localhost:6379` |\n", |
| 313 | + "| `--host` | Redis host to connect to | `localhost` |\n", |
| 314 | + "| `-p --port` | Redis port to connect to. Must be an integer | `6379` |\n", |
| 315 | + "| `--user` | Redis username, if one is required | `default` |\n", |
| 316 | + "| `--ssl` | Boolean flag indicating if ssl is required. If set the Redis base url changes to `rediss://` | None |\n", |
| 317 | + "| `-a --password`| Redis password, if one is required| `\"\"` |" |
| 318 | + ] |
| 319 | + }, |
| 320 | + { |
| 321 | + "cell_type": "markdown", |
| 322 | + "metadata": {}, |
| 323 | + "source": [ |
| 324 | + "### Choosing your Redis instance\n", |
| 325 | + "By default rvl first checks if you have `REDIS_URL` environment variable defined and tries to connect to that. If not, it then falls back to `localhost:6379`, unless you pass the `--host` or `--port` arguments" |
| 326 | + ] |
| 327 | + }, |
274 | 328 | {
|
275 | 329 | "cell_type": "code",
|
276 |
| - "execution_count": 11, |
| 330 | + "execution_count": 41, |
277 | 331 | "metadata": {},
|
278 | 332 | "outputs": [
|
279 | 333 | {
|
280 | 334 | "name": "stdout",
|
281 | 335 | "output_type": "stream",
|
282 | 336 | "text": [
|
283 |
| - "\u001b[32m22:33:45\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Index deleted successfully\n" |
| 337 | + "\u001b[32m18:13:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Using Redis address from environment variable, REDIS_URL\n", |
| 338 | + "\u001b[32m18:13:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m Indices:\n", |
| 339 | + "\u001b[32m18:13:36\u001b[0m \u001b[34m[RedisVL]\u001b[0m \u001b[1;30mINFO\u001b[0m 1. vectorizers\n" |
284 | 340 | ]
|
285 | 341 | }
|
286 | 342 | ],
|
| 343 | + "source": [ |
| 344 | + "# specify your Redis instance to connect to\n", |
| 345 | + "!rvl index listall --host localhost --port 6379" |
| 346 | + ] |
| 347 | + }, |
| 348 | + { |
| 349 | + "cell_type": "markdown", |
| 350 | + "metadata": {}, |
| 351 | + "source": [ |
| 352 | + "### Using SSL encription\n", |
| 353 | + "If your Redis instance is configured to use SSL encription then set the `--ssl` flag.\n", |
| 354 | + "You can similarly specify the username and password to construct the full Redis URL" |
| 355 | + ] |
| 356 | + }, |
| 357 | + { |
| 358 | + "cell_type": "code", |
| 359 | + "execution_count": null, |
| 360 | + "metadata": {}, |
| 361 | + "outputs": [], |
| 362 | + "source": [ |
| 363 | + "# connect to rediss://jane_doe:password123@localhost:6379\n", |
| 364 | + "!rvl index listall --user jane_doe -a password123 --ssl" |
| 365 | + ] |
| 366 | + }, |
| 367 | + { |
| 368 | + "cell_type": "code", |
| 369 | + "execution_count": null, |
| 370 | + "metadata": {}, |
| 371 | + "outputs": [], |
287 | 372 | "source": [
|
288 | 373 | "!rvl index destroy -i vectorizers"
|
289 | 374 | ]
|
290 | 375 | }
|
291 | 376 | ],
|
292 | 377 | "metadata": {
|
293 | 378 | "kernelspec": {
|
294 |
| - "display_name": "rvldev", |
| 379 | + "display_name": "redisvl-dev", |
295 | 380 | "language": "python",
|
296 | 381 | "name": "python3"
|
297 | 382 | },
|
|
305 | 390 | "name": "python",
|
306 | 391 | "nbconvert_exporter": "python",
|
307 | 392 | "pygments_lexer": "ipython3",
|
308 |
| - "version": "3.11.10" |
| 393 | + "version": "3.12.2" |
309 | 394 | }
|
310 | 395 | },
|
311 | 396 | "nbformat": 4,
|
|
0 commit comments