instantiate redis vector store with custom index schema #29433
Replies: 1 comment 1 reply
-
Hey @shiamkumar7! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together! To override the default field names in the Redis vector store when using the
text:
- name: page
from langchain_community.vectorstores import Redis
from langchain_community.embeddings.fake import FakeEmbeddings
# Define your documents and embeddings
docs = [...] # your list of documents
embeddings = FakeEmbeddings(size=128)
# Define the custom index schema
index_schema = {
"text": [
{"name": "page"}
]
}
# Create the Redis vector store with the custom index schema
redis_client = redis.from_url("redis://127.0.0.1:6379")
rvs = Redis.from_documents(
docs,
embedding=embeddings,
client=redis_client,
index_name="my_vector_index",
index_schema=index_schema
) This setup will replace the default "content" field with "page" in your Redis vector store [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to instantiate the redis vector store with a custom field name instead of the default ones. I want to override the default "content" with "page". I am using 'from_documents' to create a redis vectorstore. I am looking for the correct way to instantiate the vector store so that all the "content" field name is replaced with a custom name
Beta Was this translation helpful? Give feedback.
All reactions