Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,22 @@ fields:
```

#### Example Usage
These examples reference [provided sample data](sample-data/).

```bash
# load in a pickled dataframe with
redisvl load -s sample.yml -d embeddings.pkl
redisvl load -s sample-data/sample.yml -d sample-data/pandas-sample.pkl
```

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

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

### Support
Expand All @@ -88,7 +89,7 @@ Install the Python requirements listed in `requirements.txt`.
```bash
git clone https://github.com/RedisVentures/data-loader.git
cd redisvl
pip install .
pip install -e .
```

### Creating Input Data
Expand Down
5 changes: 3 additions & 2 deletions redisvl/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ async def create(
definition=IndexDefinition(prefix=[self.prefix], index_type=storage_type),
)

async def delete(self):
await self.redis_conn.ft(self.index_name).dropindex(delete_documents=True)
async def delete(self, dd: bool = True):
# Delete the search index
await self.redis_conn.ft(self.index_name).dropindex(delete_documents=dd)
2 changes: 1 addition & 1 deletion redisvl/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def create_vector_query(
number_of_results: int = 20,
vector_field_name: str = "vector",
tags: str = "*",
):
) -> Query:
base_query = f"{tags}=>[{search_type} {number_of_results} @{vector_field_name} $vector AS vector_score]"
return (
Query(base_query)
Expand Down
2 changes: 1 addition & 1 deletion redisvl/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _create_vector_field(
algorithm: str = "FLAT",
datatype: str = "FLOAT32",
distance_metric: str = "COSINE",
initial_cap: int = 1000000,
initial_cap: int = 20000,
block_size: int = 1000,
m: int = 16,
ef_construction: int = 200,
Expand Down
1 change: 1 addition & 0 deletions sample-data/sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fields:
separator: "|"
vector:
vector:
initial_cap: 20000
datatype: "float32"
algorithm: "flat"
dims: 768
Expand Down