Skip to content

Commit 25ef582

Browse files
tylerhutchersonSam Partee
authored andcommitted
IndexSchema refactor and async collapse (#85)
Introduce the `IndexSchema`. --------- Co-authored-by: Sam Partee <sam.partee@redis.com>
1 parent 9b870ca commit 25ef582

35 files changed

+2192
-1623
lines changed

conftest.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
import pytest
33
import asyncio
44

5-
from redisvl.utils.connection import (
6-
get_async_redis_connection,
7-
get_redis_connection
8-
)
5+
from redisvl.utils.connection import RedisConnection
6+
97
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379")
108

11-
aredis = get_async_redis_connection(REDIS_URL)
12-
redis = get_redis_connection(REDIS_URL)
9+
aredis = RedisConnection.get_async_redis_connection(REDIS_URL)
10+
redis = RedisConnection.get_redis_connection(REDIS_URL)
1311

1412
@pytest.fixture()
1513
def redis_url():

docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ myst:
1111
:caption: RedisVL
1212
:maxdepth: 2
1313
14+
indexschema
1415
searchindex
1516
query
1617
filter

docs/api/indexschema.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
*****
3+
IndexSchema
4+
*****
5+
6+
IndexSchema
7+
===========
8+
9+
.. _searchindex_api:
10+
11+
.. currentmodule:: redisvl.schema
12+
13+
.. autosummary::
14+
15+
IndexSchema.__init__
16+
IndexSchema.name
17+
IndexSchema.prefix
18+
IndexSchema.key_separator
19+
IndexSchema.storage_type
20+
IndexSchema.fields
21+
IndexSchema.redis_fields
22+
SearchIndex.add_field
23+
SearchIndex.add_fields
24+
SearchIndex.remove_field
25+
SearchIndex.generate_fields
26+
IndexSchema.from_yaml
27+
IndexSchema.to_yaml
28+
IndexSchema.from_dict
29+
IndexSchema.to_dict
30+
31+
.. autoclass:: IndexSchema
32+
:show-inheritance:
33+
:inherited-members:
34+
:members:

docs/api/searchindex.rst

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
*****
3-
Index
2+
SearchIndex
43
*****
54

65
SearchIndex
@@ -13,64 +12,32 @@ SearchIndex
1312
.. autosummary::
1413

1514
SearchIndex.__init__
15+
SearchIndex.from_yaml
16+
SearchIndex.from_dict
1617
SearchIndex.client
1718
SearchIndex.name
1819
SearchIndex.prefix
1920
SearchIndex.key_separator
2021
SearchIndex.storage_type
21-
SearchIndex.from_yaml
22-
SearchIndex.from_dict
23-
SearchIndex.from_existing
2422
SearchIndex.connect
23+
SearchIndex.disconnect
24+
SearchIndex.set_client
2525
SearchIndex.create
26+
SearchIndex.acreate
27+
SearchIndex.exists
28+
SearchIndex.aexists
2629
SearchIndex.load
30+
SearchIndex.aload
2731
SearchIndex.search
32+
SearchIndex.asearch
2833
SearchIndex.query
34+
SearchIndex.aquery
2935
SearchIndex.delete
36+
SearchIndex.adelete
3037
SearchIndex.info
31-
SearchIndex.disconnect
32-
33-
38+
SearchIndex.ainfo
3439

3540
.. autoclass:: SearchIndex
3641
:show-inheritance:
3742
:inherited-members:
3843
:members:
39-
40-
41-
AsyncSearchIndex
42-
================
43-
44-
.. _asyncsearchindex_api:
45-
46-
.. currentmodule:: redisvl.index
47-
48-
.. autosummary::
49-
50-
AsyncSearchIndex.__init__
51-
AsyncSearchIndex.client
52-
AsyncSearchIndex.name
53-
AsyncSearchIndex.prefix
54-
AsyncSearchIndex.key_separator
55-
AsyncSearchIndex.storage_type
56-
AsyncSearchIndex.from_yaml
57-
AsyncSearchIndex.from_dict
58-
AsyncSearchIndex.from_existing
59-
AsyncSearchIndex.connect
60-
AsyncSearchIndex.create
61-
AsyncSearchIndex.load
62-
AsyncSearchIndex.search
63-
AsyncSearchIndex.query
64-
AsyncSearchIndex.delete
65-
AsyncSearchIndex.info
66-
AsyncSearchIndex.disconnect
67-
68-
69-
70-
.. autoclass:: AsyncSearchIndex
71-
:show-inheritance:
72-
:inherited-members:
73-
:members:
74-
75-
76-

0 commit comments

Comments
 (0)