diff --git a/README.md b/README.md index 1c014dac..5fced046 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/redisvl/index.py b/redisvl/index.py index 46baa14e..7c588052 100644 --- a/redisvl/index.py +++ b/redisvl/index.py @@ -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) diff --git a/redisvl/query.py b/redisvl/query.py index a9dfa569..957b0203 100644 --- a/redisvl/query.py +++ b/redisvl/query.py @@ -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) diff --git a/redisvl/schema.py b/redisvl/schema.py index 7dfc9173..d791adda 100644 --- a/redisvl/schema.py +++ b/redisvl/schema.py @@ -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, diff --git a/sample-data/sample.yml b/sample-data/sample.yml index 5f2f7958..1207c6a3 100644 --- a/sample-data/sample.yml +++ b/sample-data/sample.yml @@ -14,6 +14,7 @@ fields: separator: "|" vector: vector: + initial_cap: 20000 datatype: "float32" algorithm: "flat" dims: 768