Issue with v4 Filtering (Multi-Tenancy and Cloud)

When I take a look at my objects:

doc_chunks = collection_tenant.query.fetch_objects(
    limit=2
)
doc_chunks.objects

I get returned:

[Object(uuid=_WeaviateUUIDInt('02785db3-e861-4abe-9bd0-c5bee4702a5e'), metadata=MetadataReturn(creation_time=None, last_update_time=None, distance=None, certainty=None, score=None, explain_score=None, is_consistent=None, rerank_score=None), properties={'properties': {'start_end_idx': [1336, 2056], 'creationDate': '2024-02-06', 'docId': 1.0, 'userIds': ['u123'], 'title': 'queen_ryan.pdf', 'chunk': 'the content is here.', 'folderIds': ['u123_1']}}, references=None, vector={}, collection='Document'),
 Object(uuid=_WeaviateUUIDInt('02fdb9b2-42c0-4c84-8f6e-b8b90bfb9746'), metadata=MetadataReturn(creation_time=None, last_update_time=None, distance=None, certainty=None, score=None, explain_score=None, is_consistent=None, rerank_score=None), properties={'properties': {'start_end_idx': [1479, 2331], 'creationDate': '2024-02-06', 'docId': 2.0, 'userIds': ['u123'], 'title': 'StoneHill.pdf', 'chunk': "some more text in this area", 'folderIds': ['u123_1']}}, references=None, vector={}, collection='Document')]

However, when I try to filter on the data on something that exists:

import weaviate
import weaviate.classes as wvc

documents = client.collections.get('Document')

collection_tenant = documents.with_tenant(organization_name)

response = collection_tenant.query.fetch_objects(
    filters=wvc.query.Filter.by_property('title').equal('queen_ryan.pdf'),
)
response.objects

I get an empty list. What am I/ could I be doing wrong? My filter searching is not working.

Hi @NimraOnline

could you try that on a newly created class? The only way I can explain this is that your inverted index somehow became corrupted

Hi @Dirk

Thank you for your response. I did try this and I had the same results.
I am setting up my title property like this:

            ),
                wvc.config.Property(
                name="title",
                data_type=wvc.config.DataType.TEXT,
                skip_vectorization= True,
            ),

and configuring the inverted index:

        # Configure the inverted index
        inverted_index_config=wvc.config.Configure.inverted_index(
            index_null_state=True,
            index_property_length=False,
            index_timestamps=True,

        ),

Hi @NimraOnline ! Welcome to our community :wave:

I have produced python notebook/script. Can you try this?

# connect
import weaviate
from weaviate import classes as wvc
client = weaviate.connect_to_local()

# create collections
documents = client.collections.create(
    name="Documents",
    multi_tenancy_config=wvc.config.Configure.multi_tenancy(True),
    properties=[
         wvc.config.Property(
                name="title",
                data_type=wvc.config.DataType.TEXT,
                skip_vectorization= True,
         )
    ]
)
# create tenant for a class and get it
documents.tenants.create(
        tenants=[
            wvc.tenants.Tenant(name="T1"),
            wvc.tenants.Tenant(name="T2"),
        ]
    )
documents_t1 = client.collections.get("Documents").with_tenant("T1")

# inserting two objects
documents_t1.data.insert({'title': 'StoneHill.pdf'})
documents_t1.data.insert({'title': 'SandHill.pdf'})

# searching
documents_t1.query.fetch_objects(
    filters=wvc.query.Filter.by_property('title').equal('StoneHill.pdf'),
)

# >>> QueryReturn(objects=[Object(uuid=_WeaviateUUIDInt('86a4362a-3a54-42ff-a493-02264f1064e4'), metadata=MetadataReturn(creation_time=None, last_update_time=None, distance=None, certainty=None, score=None, explain_score=None, is_consistent=None, rerank_score=None), properties={'title': 'StoneHill.pdf'}, references=None, vector={}, collection='Documents')])
1 Like

Thank you for this sample code- it made me realize the issue was with how I was inserting the data.
It is working now :grinning:

1 Like