# Async weaviate query hybrid

**URL:** <https://forum.weaviate.io/t/async-weaviate-query-hybrid/9167>\
**Category:** General\
**Tags:** bug, python\
**Created:** [December 9, 2024, 11:36am UTC](https://forum.weaviate.io/t/async-weaviate-query-hybrid/9167 "2024-12-09T11:36:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishkvell](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@ashishkvell](https://forum.weaviate.io/u/ashishkvell)\
**Post date:** [December 9, 2024, 11:36am UTC](https://forum.weaviate.io/t/async-weaviate-query-hybrid/9167/1 "2024-12-09T11:36:04Z")

</div>

I am using async weaviate 4.9.6.

i have created schema and ingest the data. when i am retriving the data i am getting the above error.

**Schema created**

```auto
{
    "name": "SessionData",
    "description": "Represents a page within a document",
    "properties": [
        Property(name="context", data_type=DataType.TEXT, description="Content of the page"),
        Property(name="file_name", data_type=DataType.TEXT, description="Name to the document") # Assuming it refers to the Document class
    ],
    "references": [
        ReferenceProperty(
            name="user_info",
            target_collection="UserInfo",
            description="uuid of user"
        ),
    ]
},
{
    "name": "UserInfo",
    "description": "Represents user information",
    "properties": [
        Property(name="user_ID", data_type=DataType.TEXT, description="Unique ID of user")
    ]
},

await client.collections.create(
    name=class_schema['name'],
    properties=class_schema['properties'],
    description=class_schema['description'],
    references=class_schema.get('references'),
    vectorizer_config = Configure.Vectorizer.none(),
    vector_index_config = Configure.VectorIndex.hnsw(
        cleanup_interval_seconds = 300,
        distance_metric = VectorDistances.L2_SQUARED,
        dynamic_ef_factor = 8,
        dynamic_ef_max = 500,
        dynamic_ef_min = 100,
        ef = 64,
        ef_construction = 128,
        flat_search_cutoff = 40000,
        max_connections = 32,
        vector_cache_max_objects = 2000000,
    
    )
)

```

**adding data**

```auto
def add_data_in_documents(pages):
    def process_page(page_content):
        object = DataObject(
            properties = {
                "context": str(page_content),
                "file_name": file_name,
            },
            uuid=uuid.uuid4(),
            vector=embedding_client.embeddings.create(
                model=EMBEDDING_MODEL,
                input=[str(page_content)]
            ).data[0].embedding,
            references={"user_info":str(user_uuid)}
        )
    objects = [process_page(page) for page in pages]
    await weaviate_client.collections.get("SessionData").data.insert_many(objects)

it returns:
 BatchObjectReturn(_all_responses=[UUID('a9bfba19-48e4-4802-a5f3-b9bc7de97ba9'), UUID('b1b7fcb6-c584-45a8-b955-1a516a6d0478')], elapsed_seconds=0.32890987396240234, errors={}, uuids={0: UUID('a9bfba19-48e4-4802-a5f3-b9bc7de97ba9'), 1: UUID('b1b7fcb6-c584-45a8-b955-1a516a6d0478')}, has_errors=False)

```

**retrive the data**

```auto
collection = client.collections.get('SessionData')
        result = await collection.query.hybrid(
            query=query_text,
            vector = vector,
filters=Filter.by_ref(link_on="user_info").by_property("user_ID").equal(user_ID),
            return_references=QueryReference(link_on="user_info", return_properties=["user_info", "file_name"])
        )

```

**error**

```auto

Error: Query call with protocol GRPC search failed with message <AioRpcError of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "explorer: get class: vector search: object vector search at index sessiondata: shard sessiondata_0kPy7HbayeX6: panic occurred: runtime error: index out of range [0] with length 0"
        debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-12-09T17:33:00.2366957+00:00", grpc_status:2, grpc_message:"explorer: get class: vector search: object vector search at index sessiondata: shard sessiondata_0kPy7HbayeX6: panic occurred: runtime error: index out of range [0] with length 0"}"

```

what is the issue here?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [December 9, 2024, 7:12pm UTC](https://forum.weaviate.io/t/async-weaviate-query-hybrid/9167/2 "2024-12-09T19:12:10Z")

</div>

hi!

Welcome to our community 🤗 !!

For technical questions, we suggest using our #Support category, as it has some questions before opening an issue.

So:

What is the server and client version you are using?  
Is this a single node?  
How have you deployed?

Thanks!
