File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 22
22
Timestamp ,
23
23
)
24
24
from redisvl .redis .utils import array_to_buffer
25
- from redisvl .utils .utils import create_ulid
26
25
27
26
# TODO expand to multiple schema types and sync + async
28
27
@@ -146,12 +145,11 @@ def sorted_range_query():
146
145
@pytest .fixture
147
146
def index (sample_data , redis_url ):
148
147
# construct a search index from the schema
149
- idx = f"user_index_{ create_ulid ()} "
150
148
index = SearchIndex .from_dict (
151
149
{
152
150
"index" : {
153
- "name" : idx ,
154
- "prefix" : idx ,
151
+ "name" : "user_index" ,
152
+ "prefix" : "v1" ,
155
153
"storage_type" : "hash" ,
156
154
},
157
155
"fields" : [
@@ -192,20 +190,17 @@ def hash_preprocess(item: dict) -> dict:
192
190
yield index
193
191
194
192
# clean up
195
- index .clear ()
196
- index .delete ()
193
+ index .delete (drop = True )
197
194
198
195
199
196
@pytest .fixture
200
197
def L2_index (sample_data , redis_url ):
201
198
# construct a search index from the schema
202
- idx = f"L2_index_{ create_ulid ()} "
203
-
204
199
index = SearchIndex .from_dict (
205
200
{
206
201
"index" : {
207
- "name" : idx ,
208
- "prefix" : idx ,
202
+ "name" : "L2_index" ,
203
+ "prefix" : "L2_index" ,
209
204
"storage_type" : "hash" ,
210
205
},
211
206
"fields" : [
@@ -245,8 +240,7 @@ def hash_preprocess(item: dict) -> dict:
245
240
yield index
246
241
247
242
# clean up
248
- index .clear ()
249
- index .delete ()
243
+ index .delete (drop = True )
250
244
251
245
252
246
def test_search_and_query (index ):
You can’t perform that action at this time.
0 commit comments