client: python client 4.4.rc1
weavite: 1.23.7
code to reproduce the bug
import weaviate
from weaviate.collections.classes.config import Property, DataType, ReferenceProperty
from weaviate.collections.classes.filters import Filter
from base_dependencies import load_config
client = weaviate.connect_to_custom(
http_host=load_config("weaviate")["host"],
http_port=load_config("weaviate")["http_port"],
http_secure=False,
grpc_host="localhost",
grpc_port=load_config("weaviate")["grpc_port"],
grpc_secure=False,
auth_credentials=weaviate.auth.AuthApiKey(api_key=load_config("weaviate")["api_key"])
)
client.collections.delete(["a", "b", ])
b = client.collections.create(
"b",
properties=[
Property(name="text", data_type=DataType.TEXT),
Property(name="code", data_type=DataType.TEXT),
],
)
a = client.collections.create(
name="a", references=[ReferenceProperty(name="has_b", target_collection=b.name)]
)
b1 = b.data.insert(properties={"text": "text1", "code": "1752871214070435840321"})
b2 = b.data.insert(properties={"text": "text2", "code": "1752871214070435840521"})
b3 = b.data.insert(properties={"text": "text3", "code": "1752871214070435840621"})
b4 = b.data.insert(properties={"text": "text4", "code": "1752871214070435840721"})
a1 = a.data.insert({}, references={"has_b": [b1, b2]})
a2 = a.data.insert({}, references={"has_b": [b3, b4]})
objects = a.query.fetch_objects(
filters=Filter.by_ref("has_b").by_property("code").greater_or_equal("1752871214070435840326")
& Filter.by_ref("has_b").by_property("code").less_or_equal("1752871214070435840327")
).objects
print(objects)
print(len(objects))
ssert len(objects) == 0
expect behavior:
should find no object since there is no b object with code fullfill the query condition but the code could find one.