Open ndettmer opened 2 weeks ago
Hello @ndettmer! I'm here to help you with any bugs, questions, or contributions you have regarding the repository. If you need any assistance, feel free to ask.
I found a similar closed issue: [Question]: Can't get metadata from weaviate. The suggested solution was to change the structure of the filter, including the path and the value [1].
The error "no such prop with name 'id' found in class" occurs because the property name 'id' does not exist in the Weaviate class schema. The correct property name should be used instead.
In the query
method, when filtering with node IDs, the code uses the path ["id"]
:
if query.node_ids:
filter_with_node_ids = {
"operator": "Or",
"operands": [
{"path": ["id"], "operator": "Equal", "valueText": node_id}
for node_id in query.node_ids
],
}
query_builder = query_builder.with_where(filter_with_node_ids)
However, the property name 'id' is not a valid property in the Weaviate schema. You should use the correct property name that corresponds to the node ID in your schema. For example, if the node ID is stored under the property name 'node_id', you should modify the path accordingly:
if query.node_ids:
filter_with_node_ids = {
"operator": "Or",
"operands": [
{"path": ["node_id"], "operator": "Equal", "valueText": node_id}
for node_id in query.node_ids
],
}
query_builder = query_builder.with_where(filter_with_node_ids)
Make sure to replace "node_id"
with the actual property name used in your Weaviate schema for node IDs [2].
To continue talking to Dosu, mention @dosu.
I think most people don't hit this bug because they don't use an index store (just the vector store is all you really need)
Bug Description
When querying a WeaviateVectorStore based on a VectorStoreIndex that holds node_ids, the Weaviate server throws an error "no such prop with name 'id' found in class"
The cause of this error might be the filter in the query function that is looking for the
"id"
property, while the deafult schema's properties don't have this field.Version
0.11.2
Steps to Reproduce
Relevant Logs/Tracbacks