I’m trying to index and search articles in Weaviate, but I’m encountering an error when querying with near_vector
. Here’s my process:
- Indexing: I successfully index articles in the “Test” class, with each article having an
article_id
,title
, andbody
. The vectors are correctly linked based onarticle_id
.
{
"class_name": "test",
"data": [
{ "article_id": "0", "title": "title0", "body": "body0" },
{ "article_id": "1", "title": "title1", "body": "body1" },
...
],
"vectors": {
"0": [3.7, 1.4, 4.9, 2.1, 5.6, 7.2, 8.3, 6.5],
...
}
}
- Search: When I query with
near_vector
to retrievetitle
anddistance
, I get the following error:
raise ValueError(f"An error occurred while performing weaviate search : {e}")
ValueError: An error occurred while performing weaviate search : Query call with protocol GRPC search failed with message <AioRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "no such prop with name 'title' found in class 'Test' in the schema. Check your schema files for which properties in this class are available"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-11-08T12:25:18.79653+05:30", grpc_status:2, grpc_message:"no such prop with name \'title\' found in class \'Test\' in the schema. Check your schema files for which properties in this class are available"}"
- The indexing appears successful, and I see no issues in the schema setup. Why is this property not accessible in the search query?
Code:
response = weaviate_client.collections.get(weaviate_class_name).query.near_vector(
near_vector=embedding,
limit=20,
return_metadata=MetadataQuery(distance=True),
return_properties=['title']
)
Any suggestions? Thank you!