import os import weaviate client = weaviate.Client("http://localhost:8080" ) vector_store = WeaviateVectorStore( weaviate_client=client, index_name="Test1", text_key="text" ) retriever = VectorStoreIndex.from_vector_store(vector_store=vector_store, embed_model='local').as_retriever( similarity_top_k=2 )
100 kwargs.pop("storage_context", None) 101 storage_context = StorageContext.from_defaults(vector_store=vector_store) --> 103 return cls( 104 nodes=[], 105 embed_model=embed_model, ... 115 ) 117 if LCEmbeddings is not None and isinstance(embed_model, LCEmbeddings): 118 try: ImportError: `llama-index-embeddings-huggingface` package not found, please run `pip install llama-index-embeddings-huggingface`
ValueError
related to the metadata
field in a Weaviate vector store query. The extracts do not cover troubleshooting or fixing errors related to querying vector stores, especially with the metadata
field requirements in Weaviate.metadata
field of type Test1_metadata_object
. This typically means that when querying a GraphQL API (which Weaviate uses for queries), you must specify which fields of the metadata
object you want to retrieve in your query. metadata
field.metadata
field. Please note, this is a general example and not extracted from the provided documentation:{ Get { Test1(where: {operator: Equal, path: ["page_number"], valueInt: 1}) { text metadata { page_number # Include other metadata fields you need here } } } }
Test1
and you're interested in entries where the page_number
is 1
. It specifies that you want to retrieve the text
field and a sub-selection of the metadata
field, including page_number
and potentially other metadata fields.metadata
.metadata
object containing nested properties. To query such a structure, especially when dealing with an error that requires specifying a sub-selection for the metadata
field, you need to adjust your GraphQL query accordingly.{ Get { Test1(where: {path: ["metadata", "page_number"], operator: Equal, valueString: "1"}) { text metadata { embed_text chunk_id previous_chunk_id next_chunk_id page_number file_name file_id } } } }
Test1
where the page_number
within the metadata
object equals "1". It specifies that you want to retrieve the text
field of the document as well as various fields within the metadata
object.where
clause in the query uses valueString
to match the page_number
since your schema indicates that page_number
is of data type TEXT
. Adjust the valueString
to valueInt
or another appropriate type if the actual data type of your page_number
or any other field differs.where
filter in your GraphQL query, specifically related to the page_number
argument. The error suggests that the query is missing an argument after page_number
, which likely means there's a formatting issue with how the filter is specified.where
filter in your GraphQL query is correctly formatted according to Weaviate's requirements for filtering on nested properties within an OBJECT
type. where
filter is properly formatted. This example assumes you're trying to filter based on the page_number
within the metadata
object:{ Get { Test1(where: {path: ["metadata", "page_number"], operator: Equal, valueString: "1"}) { text metadata { embed_text chunk_id previous_chunk_id next_chunk_id page_number file_name file_id } } } }
path
is correctly specified as an array, including the object name (metadata
) and the property name (page_number
).Equal
in this case) for your filter condition.valueString
in this example) that matches the data type of the field you're filtering on. Since page_number
is of type TEXT
in your schema, valueString
is used.where
filters, especially for nested properties. The documentation will provide insights into the correct syntax and available operators for filtering your queries effectively.