You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/schema.rst
+69-12Lines changed: 69 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,36 +60,80 @@ Fields in the schema can be defined in YAML format or as a Python dictionary, sp
60
60
}
61
61
}
62
62
63
-
Supported Field Types and Attributes
64
-
====================================
63
+
Basic Field Types
64
+
=================
65
65
66
-
Each field type supports specific attributes that customize its behavior. Below are the field types and their available attributes:
66
+
RedisVL supports several basic field types for indexing different kinds of data. Each field type has specific attributes that customize its indexing and search behavior.
67
67
68
-
**Text Field Attributes**:
68
+
Text Fields
69
+
-----------
70
+
71
+
Text fields support full-text search with stemming, phonetic matching, and other text analysis features.
72
+
73
+
.. currentmodule:: redisvl.schema.fields
74
+
75
+
.. autoclass:: TextField
76
+
:members:
77
+
:show-inheritance:
69
78
70
79
.. autoclass:: TextFieldAttributes
71
80
:members:
72
81
:undoc-members:
73
82
74
-
**Tag Field Attributes**:
83
+
Tag Fields
84
+
----------
85
+
86
+
Tag fields are optimized for exact-match filtering and faceted search on categorical data.
87
+
88
+
.. autoclass:: TagField
89
+
:members:
90
+
:show-inheritance:
75
91
76
92
.. autoclass:: TagFieldAttributes
77
93
:members:
78
94
:undoc-members:
79
95
80
-
**Numeric Field Attributes**:
96
+
Numeric Fields
97
+
--------------
98
+
99
+
Numeric fields support range queries and sorting on numeric data.
100
+
101
+
.. autoclass:: NumericField
102
+
:members:
103
+
:show-inheritance:
81
104
82
105
.. autoclass:: NumericFieldAttributes
83
106
:members:
84
107
:undoc-members:
85
108
86
-
**Geo Field Attributes**:
109
+
Geo Fields
110
+
----------
111
+
112
+
Geo fields enable location-based search with geographic coordinates.
113
+
114
+
.. autoclass:: GeoField
115
+
:members:
116
+
:show-inheritance:
87
117
88
118
.. autoclass:: GeoFieldAttributes
89
119
:members:
90
120
:undoc-members:
91
121
92
-
**Common Vector Field Attributes**:
122
+
Vector Field Types
123
+
==================
124
+
125
+
Vector fields enable semantic similarity search using various algorithms. All vector fields share common attributes but have algorithm-specific configurations.
126
+
127
+
Common Vector Attributes
128
+
------------------------
129
+
130
+
All vector field types share these base attributes:
131
+
132
+
.. autoclass:: BaseVectorFieldAttributes
133
+
:members:
134
+
:undoc-members:
135
+
136
+
**Key Attributes:**
93
137
94
138
- `dims`: Dimensionality of the vector (e.g., 768, 1536).
95
139
- `algorithm`: Indexing algorithm for vector search:
@@ -106,7 +150,8 @@ Each field type supports specific attributes that customize its behavior. Below
106
150
- `initial_cap`: Initial capacity hint for memory allocation (optional).
107
151
- `index_missing`: When True, allows searching for documents missing this field (optional).
108
152
109
-
**HNSW Vector Field Specific Attributes**:
153
+
HNSW Vector Fields
154
+
------------------
110
155
111
156
HNSW (Hierarchical Navigable Small World) - Graph-based approximate search with excellent recall. **Best for general-purpose vector search (10K-1M+ vectors).**
112
157
@@ -127,7 +172,9 @@ HNSW (Hierarchical Navigable Small World) - Graph-based approximate search with
127
172
- **Recall quality**: Excellent recall rates (95-99%), often better than other approximate methods
128
173
- **Build time**: Moderate construction time, faster than SVS-VAMANA for smaller datasets
129
174
130
-
.. currentmodule:: redisvl.schema.fields
175
+
.. autoclass:: HNSWVectorField
176
+
:members:
177
+
:show-inheritance:
131
178
132
179
.. autoclass:: HNSWVectorFieldAttributes
133
180
:members:
@@ -167,7 +214,8 @@ HNSW (Hierarchical Navigable Small World) - Graph-based approximate search with
167
214
ef_construction: 400
168
215
ef_runtime: 50
169
216
170
-
**SVS-VAMANA Vector Field Specific Attributes**:
217
+
SVS-VAMANA Vector Fields
218
+
------------------------
171
219
172
220
SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast approximate nearest neighbor search with optional compression support. This algorithm is optimized for Intel hardware and offers reduced memory usage through vector compression. **Best for large datasets (>100K vectors) on Intel hardware with memory constraints.**
173
221
@@ -204,6 +252,10 @@ SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast ap
204
252
205
253
- LeanVec4x8 + reduce to 384: 580 MB (~81% savings)
206
254
255
+
.. autoclass:: SVSVectorField
256
+
:members:
257
+
:show-inheritance:
258
+
207
259
.. autoclass:: SVSVectorFieldAttributes
208
260
:members:
209
261
:undoc-members:
@@ -254,7 +306,8 @@ SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast ap
254
306
- **Platform considerations**: Intel's proprietary LVQ and LeanVec optimizations are not available in Redis Open Source. On non-Intel platforms and Redis Open Source, SVS-VAMANA with compression falls back to basic 8-bit scalar quantization.
255
307
- **Performance tip**: Start with default parameters and tune `search_window_size` first for your speed vs accuracy requirements.
256
308
257
-
**FLAT Vector Field Specific Attributes**:
309
+
FLAT Vector Fields
310
+
------------------
258
311
259
312
FLAT - Brute-force exact search. **Best for small datasets (<10K vectors) requiring 100% accuracy.**
260
313
@@ -277,6 +330,10 @@ FLAT - Brute-force exact search. **Best for small datasets (<10K vectors) requir
277
330
- **vs HNSW**: Much slower search but exact results, faster index building
278
331
- **vs SVS-VAMANA**: Slower search and higher memory usage, but exact results
0 commit comments