Skip to content

Commit f430514

Browse files
Enhance README, docs, and examples (#105)
This PR enhances the quality of the RedisVL README: - Improved layout optimized for readability - Emojis for the eye pop effect - Links to docs - Simple code examples - Fixes https://github.com/RedisVentures/redisvl/issues/115 - Fixes https://github.com/RedisVentures/redisvl/issues/89
1 parent 8d38801 commit f430514

File tree

20 files changed

+806
-532
lines changed

20 files changed

+806
-532
lines changed

README.md

Lines changed: 249 additions & 42 deletions
Large diffs are not rendered by default.

docs/api/cache.rst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@ SemanticCache
88

99
.. _semantic_cache_api:
1010

11-
.. currentmodule:: redisvl.llmcache.semantic
12-
13-
.. autosummary::
14-
15-
SemanticCache.__init__
16-
SemanticCache.check
17-
SemanticCache.store
18-
SemanticCache.clear
19-
SemanticCache.delete
20-
SemanticCache.distance_threshold
21-
SemanticCache.set_threshold
22-
SemanticCache.ttl
23-
SemanticCache.set_ttl
24-
11+
.. currentmodule:: redisvl.extensions.llmcache
2512

2613
.. autoclass:: SemanticCache
2714
:show-inheritance:

docs/api/filter.rst

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,10 @@ Tag
1616

1717
.. currentmodule:: redisvl.query.filter
1818

19-
.. autosummary::
20-
21-
Tag.__init__
22-
Tag.__eq__
23-
Tag.__ne__
24-
Tag.__str__
25-
26-
2719
.. autoclass:: Tag
28-
:show-inheritance:
2920
:members:
3021
:special-members:
31-
:inherited-members:
32-
22+
:exclude-members: __hash__
3323

3424

3525
Text
@@ -38,19 +28,11 @@ Text
3828

3929
.. currentmodule:: redisvl.query.filter
4030

41-
.. autosummary::
42-
43-
Text.__init__
44-
Text.__eq__
45-
Text.__ne__
46-
Text.__mod__
47-
Text.__str__
48-
4931

5032
.. autoclass:: Text
51-
:show-inheritance:
5233
:members:
5334
:special-members:
35+
:exclude-members: __hash__
5436

5537

5638
Num
@@ -59,52 +41,30 @@ Num
5941

6042
.. currentmodule:: redisvl.query.filter
6143

62-
.. autosummary::
63-
64-
Num.__init__
65-
Num.__eq__
66-
Num.__ne__
67-
Num.__lt__
68-
Num.__le__
69-
Num.__gt__
70-
Num.__ge__
71-
Num.__str__
72-
7344

7445
.. autoclass:: Num
75-
:show-inheritance:
7646
:members:
7747
:special-members:
48+
:exclude-members: __hash__
7849

7950

8051
Geo
8152
===
8253

8354
.. currentmodule:: redisvl.query.filter
8455

85-
.. autosummary::
86-
87-
Geo.__init__
88-
Geo.__eq__
89-
Geo.__ne__
90-
Geo.__str__
91-
9256
.. autoclass:: Geo
93-
:show-inheritance:
9457
:members:
9558
:special-members:
59+
:exclude-members: __hash__
9660

9761

9862
GeoRadius
9963
=========
10064

10165
.. currentmodule:: redisvl.query.filter
10266

103-
.. autosummary::
104-
105-
GeoRadius.__init__
106-
10767
.. autoclass:: GeoRadius
108-
:show-inheritance:
10968
:members:
110-
:special-members:
69+
:special-members:
70+
:exclude-members: __hash__

docs/api/query.rst

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ VectorQuery
1010

1111
.. currentmodule:: redisvl.query
1212

13-
.. autosummary::
14-
15-
VectorQuery.__init__
16-
VectorQuery.set_filter
17-
VectorQuery.get_filter
18-
VectorQuery.query
19-
VectorQuery.params
20-
2113

2214
.. autoclass:: VectorQuery
23-
:show-inheritance:
2415
:members:
2516
:inherited-members:
2617

@@ -31,17 +22,8 @@ RangeQuery
3122

3223
.. currentmodule:: redisvl.query
3324

34-
.. autosummary::
35-
36-
RangeQuery.__init__
37-
RangeQuery.set_filter
38-
RangeQuery.get_filter
39-
RangeQuery.query
40-
RangeQuery.params
41-
4225

4326
.. autoclass:: RangeQuery
44-
:show-inheritance:
4527
:members:
4628
:inherited-members:
4729

@@ -52,17 +34,8 @@ FilterQuery
5234

5335
.. currentmodule:: redisvl.query
5436

55-
.. autosummary::
56-
57-
FilterQuery.__init__
58-
FilterQuery.set_filter
59-
FilterQuery.get_filter
60-
FilterQuery.query
61-
FilterQuery.params
62-
6337

6438
.. autoclass:: FilterQuery
65-
:show-inheritance:
6639
:members:
6740
:inherited-members:
6841

@@ -73,16 +46,7 @@ CountQuery
7346

7447
.. currentmodule:: redisvl.query
7548

76-
.. autosummary::
77-
78-
CountQuery.__init__
79-
CountQuery.set_filter
80-
CountQuery.get_filter
81-
CountQuery.query
82-
CountQuery.params
83-
8449

8550
.. autoclass:: CountQuery
86-
:show-inheritance:
8751
:members:
8852
:inherited-members:

docs/api/schema.rst

Lines changed: 83 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,102 @@
1-
21
***********
32
Schema
43
***********
54

5+
Schema in RedisVL provides a structured format to define index settings and
6+
field configurations using the following three components:
7+
8+
.. list-table::
9+
:widths: 20 80
10+
:header-rows: 1
11+
12+
* - Component
13+
- Description
14+
* - `version`
15+
- The version of the schema spec. Current supported version is `0.1.0`.
16+
* - `index`
17+
- Index specific settings like name, key prefix, key separator, and storage type.
18+
* - `fields`
19+
- Subset of fields within your data to include in the index and any custom settings.
20+
21+
622
IndexSchema
723
===========
824

9-
.. _searchindex_api:
25+
.. _indexschema_api:
1026

1127
.. currentmodule:: redisvl.schema
1228

13-
.. autosummary::
14-
15-
IndexSchema.index
16-
IndexSchema.fields
17-
IndexSchema.version
18-
IndexSchema.field_names
19-
IndexSchema.redis_fields
20-
IndexSchema.add_field
21-
IndexSchema.add_fields
22-
IndexSchema.remove_field
23-
IndexSchema.from_yaml
24-
IndexSchema.to_yaml
25-
IndexSchema.from_dict
26-
IndexSchema.to_dict
27-
2829
.. autoclass:: IndexSchema
29-
:show-inheritance:
30-
:inherited-members:
3130
:members:
31+
:exclude-members: generate_fields,validate_and_create_fields,redis_fields
3232

3333

34-
IndexInfo
35-
=========
34+
Defining Fields
35+
===============
3636

37-
.. currentmodule:: redisvl.schema
37+
Fields in the schema can be defined in YAML format or as a Python dictionary, specifying a name, type, an optional path, and attributes for customization.
3838

39-
.. autosummary::
39+
**YAML Example**:
4040

41-
IndexInfo.name
42-
IndexInfo.prefix
43-
IndexInfo.key_separator
44-
IndexInfo.storage_type
41+
.. code-block:: yaml
4542
43+
- name: title
44+
type: text
45+
path: $.document.title
46+
attrs:
47+
weight: 1.0
48+
no_stem: false
49+
withsuffixtrie: true
4650
47-
.. autoclass:: IndexInfo
48-
:show-inheritance:
49-
:inherited-members:
50-
:members:
51+
**Python Dictionary Example**:
52+
53+
.. code-block:: python
54+
55+
{
56+
"name": "location",
57+
"type": "geo",
58+
"attrs": {
59+
"sortable": true
60+
}
61+
}
62+
63+
Supported Field Types and Attributes
64+
====================================
65+
66+
Each field type supports specific attributes that customize its behavior. Below are the field types and their available attributes:
67+
68+
**Text Field Attributes**:
69+
70+
- `weight`: Importance of the field in result calculation.
71+
- `no_stem`: Disables stemming during indexing.
72+
- `withsuffixtrie`: Optimizes queries by maintaining a suffix trie.
73+
- `phonetic_matcher`: Enables phonetic matching.
74+
- `sortable`: Allows sorting on this field.
75+
76+
**Tag Field Attributes**:
77+
78+
- `separator`: Character for splitting text into individual tags.
79+
- `case_sensitive`: Case sensitivity in tag matching.
80+
- `withsuffixtrie`: Suffix trie optimization for queries.
81+
- `sortable`: Enables sorting based on the tag field.
82+
83+
**Numeric and Geo Field Attributes**:
84+
85+
- Both numeric and geo fields support the `sortable` attribute, enabling sorting on these fields.
86+
87+
**Common Vector Field Attributes**:
88+
89+
- `dims`: Dimensionality of the vector.
90+
- `algorithm`: Indexing algorithm (`flat` or `hnsw`).
91+
- `datatype`: Float datatype of the vector (`float32` or `float64`).
92+
- `distance_metric`: Metric for measuring query relevance (`COSINE`, `L2`, `IP`).
93+
94+
**HNSW Vector Field Specific Attributes**:
95+
96+
- `m`: Max outgoing edges per node in each layer.
97+
- `ef_construction`: Max edge candidates during build time.
98+
- `ef_runtime`: Max top candidates during search.
99+
- `epsilon`: Range search boundary factor.
100+
101+
Note:
102+
See fully documented Redis-supported fields and options here: https://redis.io/commands/ft.create/

docs/api/searchindex.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ SearchIndex
2121
.. currentmodule:: redisvl.index
2222

2323
.. autoclass:: SearchIndex
24-
:show-inheritance:
2524
:inherited-members:
2625
:members:
2726

@@ -33,6 +32,5 @@ AsyncSearchIndex
3332
.. currentmodule:: redisvl.index
3433

3534
.. autoclass:: AsyncSearchIndex
36-
:show-inheritance:
3735
:inherited-members:
3836
:members:

0 commit comments

Comments
 (0)