Commit eb1a907
authored
Enable creating an index "from_existing" (#174)
Since version 2.8.10 of the search module in Redis, `FT.INFO` now
reports the contents of the index and associated fields and all low
level attributes. Raw response from Redis:
```
1) index_name
2) user_simple
3) index_options
4) (empty array)
5) index_definition
6) 1) key_type
2) HASH
3) prefixes
4) 1) user_simple_docs
5) default_score
6) "1"
7) attributes
8) 1) 1) identifier
2) user
3) attribute
4) user
5) type
6) TAG
7) SEPARATOR
8) ,
2) 1) identifier
2) credit_score
3) attribute
4) credit_score
5) type
6) TAG
7) SEPARATOR
8) ,
3) 1) identifier
2) job
3) attribute
4) job
5) type
6) TEXT
7) WEIGHT
8) "1"
4) 1) identifier
2) age
3) attribute
4) age
5) type
6) NUMERIC
5) 1) identifier
2) user_embedding
3) attribute
4) user_embedding
5) type
6) VECTOR
7) algorithm
8) FLAT
9) data_type
10) FLOAT32
11) dim
12) (integer) 3
13) distance_metric
14) COSINE
9) num_docs
10) "0"
11) max_doc_id
12) "0"
13) num_terms
14) "0"
15) num_records
16) "0"
17) inverted_sz_mb
18) "0"
19) vector_index_sz_mb
20) "0.00818634033203125"
21) total_inverted_index_blocks
22) "1813"
23) offset_vectors_sz_mb
24) "0"
25) doc_table_size_mb
26) "0"
27) sortable_values_size_mb
28) "0"
29) key_table_size_mb
30) "0"
31) geoshapes_sz_mb
32) "0"
33) records_per_doc_avg
34) "nan"
35) bytes_per_record_avg
36) "nan"
37) offsets_per_term_avg
38) "nan"
39) offset_bits_per_record_avg
40) "nan"
41) hash_indexing_failures
42) "0"
43) total_indexing_time
44) "0"
45) indexing
46) "0"
47) percent_indexed
48) "1"
49) number_of_uses
50) (integer) 2
51) cleaning
52) (integer) 0
53) gc_stats
54) 1) bytes_collected
2) "0"
3) total_ms_run
4) "0"
5) total_cycles
6) "0"
7) average_cycle_time_ms
8) "nan"
9) last_run_time_ms
10) "0"
11) gc_numeric_trees_missed
12) "0"
13) gc_blocks_denied
14) "0"
55) cursor_stats
56) 1) global_idle
2) (integer) 0
3) global_total
4) (integer) 0
5) index_capacity
6) (integer) 128
7) index_total
8) (integer) 0
57) dialect_stats
58) 1) dialect_1
2) (integer) 0
3) dialect_2
4) (integer) 0
5) dialect_3
6) (integer) 0
7) dialect_4
8) (integer) 0
59) Index Errors
60) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
61) field statistics
62) 1) 1) identifier
2) user
3) attribute
4) user
5) Index Errors
6) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
2) 1) identifier
2) credit_score
3) attribute
4) credit_score
5) Index Errors
6) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
3) 1) identifier
2) job
3) attribute
4) job
5) Index Errors
6) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
4) 1) identifier
2) age
3) attribute
4) age
5) Index Errors
6) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
5) 1) identifier
2) user_embedding
3) attribute
4) user_embedding
5) Index Errors
6) 1) indexing failures
2) (integer) 0
3) last indexing error
4) N/A
5) last indexing error key
6) "N/A"
```
This enables the ability to "hydrate" a RedisVL `IndexSchema` class from
this output. This makes state management for index information MUCH
simpler. The caveat is that this capability is only available in newer
versions of redis/search. So we have to hide it behind a "Feature flag"
of sorts. This is directly needed in our integration clients like
LangChain and LlamaIndex too.1 parent 2e5ba37 commit eb1a907
File tree
6 files changed
+461
-73
lines changed- redisvl
- index
- redis
- tests/integration
6 files changed
+461
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
105 | | - | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | | - | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
| |||
317 | 320 | | |
318 | 321 | | |
319 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
320 | 351 | | |
321 | 352 | | |
322 | 353 | | |
| |||
653 | 684 | | |
654 | 685 | | |
655 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
656 | 696 | | |
657 | | - | |
| 697 | + | |
658 | 698 | | |
659 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
660 | 704 | | |
661 | 705 | | |
662 | 706 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
| 707 | + | |
| 708 | + | |
672 | 709 | | |
673 | 710 | | |
674 | 711 | | |
| |||
698 | 735 | | |
699 | 736 | | |
700 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
701 | 768 | | |
702 | 769 | | |
703 | 770 | | |
| |||
1035 | 1102 | | |
1036 | 1103 | | |
1037 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1038 | 1113 | | |
1039 | | - | |
| 1114 | + | |
1040 | 1115 | | |
1041 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
1042 | 1121 | | |
1043 | 1122 | | |
1044 | 1123 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
| 1124 | + | |
| 1125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
46 | 127 | | |
47 | 128 | | |
48 | 129 | | |
| |||
128 | 209 | | |
129 | 210 | | |
130 | 211 | | |
131 | | - | |
| 212 | + | |
132 | 213 | | |
133 | 214 | | |
134 | 215 | | |
135 | 216 | | |
136 | 217 | | |
137 | 218 | | |
138 | | - | |
| 219 | + | |
139 | 220 | | |
140 | 221 | | |
141 | 222 | | |
| |||
145 | 226 | | |
146 | 227 | | |
147 | 228 | | |
148 | | - | |
| 229 | + | |
149 | 230 | | |
150 | 231 | | |
151 | 232 | | |
152 | | - | |
| 233 | + | |
153 | 234 | | |
154 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
155 | 244 | | |
156 | 245 | | |
157 | 246 | | |
158 | 247 | | |
159 | | - | |
| 248 | + | |
160 | 249 | | |
161 | 250 | | |
162 | 251 | | |
| |||
168 | 257 | | |
169 | 258 | | |
170 | 259 | | |
171 | | - | |
| 260 | + | |
172 | 261 | | |
173 | 262 | | |
174 | | - | |
| 263 | + | |
175 | 264 | | |
176 | 265 | | |
177 | 266 | | |
178 | 267 | | |
179 | 268 | | |
180 | | - | |
| 269 | + | |
181 | 270 | | |
182 | 271 | | |
183 | 272 | | |
| |||
189 | 278 | | |
190 | 279 | | |
191 | 280 | | |
192 | | - | |
| 281 | + | |
193 | 282 | | |
194 | 283 | | |
195 | | - | |
| 284 | + | |
196 | 285 | | |
197 | 286 | | |
198 | 287 | | |
| |||
232 | 321 | | |
233 | 322 | | |
234 | 323 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments