Skip to content

Commit ffc3360

Browse files
readme and param defaults update (#3)
- Updated `pip install` and examples in README to point to `sample-data/` - Updated default value for `initial_cap` param on Vector field - Updated index deletion function to allow for future behavior customization [ committed by @tylerhutcherson ] [ reviewed by @Spartee ]
1 parent e3a97e9 commit ffc3360

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,22 @@ fields:
5050
```
5151
5252
#### Example Usage
53+
These examples reference [provided sample data](sample-data/).
5354
5455
```bash
5556
# load in a pickled dataframe with
56-
redisvl load -s sample.yml -d embeddings.pkl
57+
redisvl load -s sample-data/sample.yml -d sample-data/pandas-sample.pkl
5758
```
5859

5960
```bash
6061
# load in a pickled dataframe to a specific address and port
61-
redisvl load -s sample.yml -d embeddings.pkl -h 127.0.0.1 -p 6379
62+
redisvl load -s sample-data/sample.yml -d sample-data/pandas-sample.pkl -h 127.0.0.1 -p 6379
6263
```
6364

6465
```bash
6566
# load in a pickled dataframe to a specific
6667
# address and port and with password
67-
redisvl load -s sample.yml -d embeddings.pkl -h 127.0.0.1 -p 6379 -p supersecret
68+
redisvl load -s sample-data/sample.yml -d sample-data/pandas-sample.pkl -h 127.0.0.1 -p 6379 -p supersecret
6869
```
6970

7071
### Support
@@ -88,7 +89,7 @@ Install the Python requirements listed in `requirements.txt`.
8889
```bash
8990
git clone https://github.com/RedisVentures/data-loader.git
9091
cd redisvl
91-
pip install .
92+
pip install -e .
9293
```
9394

9495
### Creating Input Data

redisvl/index.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ async def create(
8484
definition=IndexDefinition(prefix=[self.prefix], index_type=storage_type),
8585
)
8686

87-
async def delete(self):
88-
await self.redis_conn.ft(self.index_name).dropindex(delete_documents=True)
87+
async def delete(self, dd: bool = True):
88+
# Delete the search index
89+
await self.redis_conn.ft(self.index_name).dropindex(delete_documents=dd)

redisvl/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def create_vector_query(
99
number_of_results: int = 20,
1010
vector_field_name: str = "vector",
1111
tags: str = "*",
12-
):
12+
) -> Query:
1313
base_query = f"{tags}=>[{search_type} {number_of_results} @{vector_field_name} $vector AS vector_score]"
1414
return (
1515
Query(base_query)

redisvl/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _create_vector_field(
8888
algorithm: str = "FLAT",
8989
datatype: str = "FLOAT32",
9090
distance_metric: str = "COSINE",
91-
initial_cap: int = 1000000,
91+
initial_cap: int = 20000,
9292
block_size: int = 1000,
9393
m: int = 16,
9494
ef_construction: int = 200,

sample-data/sample.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fields:
1414
separator: "|"
1515
vector:
1616
vector:
17+
initial_cap: 20000
1718
datatype: "float32"
1819
algorithm: "flat"
1920
dims: 768

0 commit comments

Comments
 (0)