# Group by using hybrid search - JS Client

**URL:** <https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955>\
**Category:** Support\
**Tags:** javascript\
**Created:** [September 9, 2025, 4:23am UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955 "2025-09-09T04:23:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawwi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/pawwi/32/3900_2.png) [@pawwi](https://forum.weaviate.io/u/pawwi)\
**Post date:** [September 9, 2025, 4:23am UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/1 "2025-09-09T04:23:07Z")

</div>

### Description

I’m trying to run a hybrid aggregate query that groups results by a `tags` property (an array) so I can get aggregates per tag. I’m passing a named vector (via `targetVector`) but the query fails with an error that looks like the named vector is empty.

**What I expect**  
Group aggregated results by each tag while using hybrid search (named vector + alpha).

**Code (JS client v3.8.x)**

```auto
const results = await Article.aggregate.groupBy.hybrid(q, {
  groupBy: { property: 'tags' },
  vector: embedding,
  objectLimit: 250,
  targetVector: 'embedding_text_vector', // named vector defined on the class
  alpha: 0.8
});

```

**Actual error**

```auto
WeaviateQueryError: Query call with protocol gRPC failed with message: /weaviate.v1.Weaviate/Aggregate UNKNOWN: aggregate: shard Nh4bhyq0ZBX0: no vector index for target vector “”

```

The error suggests the target vector name is empty (i.e. `""`) even though I passed `targetVector: 'embedding_text_vector'`.

Server Setup Information

- Weaviate Server Version: 1.31
- Deployment Method: Local
- Multi Node? Number of Running Nodes: 1
- Client Language and Version: JS Client, 3.8.1
- Multitenancy?: No

### **Additional context / notes**

- The `Article` class has a `tags` property (array) and a named vector property `embedding_text_vector` (indexed).

- I’m using a hybrid aggregate `groupBy` call (not a simple `graphql` query); my aim is to get aggregated results grouped by each tag while leveraging hybrid scoring (alpha + named target vector).

**Question / help needed**

- Is `targetVector` supported by `aggregate.groupBy.hybrid()` for named vectors?

- Could this be a client-side usage bug, or am I missing a server/schema configuration step (e.g., enabling the named vector index on the class/property)?

- Any suggestions for debugging steps to confirm whether the named vector index exists and is accessible to the aggregate call?

Thanks in advance — happy to share the class schema or additional logs if that helps.

---

<div class="post-metadata">

**Author:** ![Chaitanya\_Kulthe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/chaitanya_kulthe/32/7546_2.png) [@Chaitanya\_Kulthe](https://forum.weaviate.io/u/Chaitanya_Kulthe)\
**Post date:** [September 9, 2025, 9:37am UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/2 "2025-09-09T09:37:30Z")

</div>

Hey @pawwi

The root cause is that the JS client (v3.8.x) doesn’t pass `targetVector` to `aggregate.groupBy.hybrid()`, so Weaviate gets an empty string and throws the “no vector index” error. Your named vector is fine it’s just a client-side gap.

What you can do right now:

- If the default vector is okay, drop `targetVector` and the call will work.

- If you need your named vector, switch to a raw GraphQL aggregate query for the moment; GraphQL **does** forward `targetVector`.

Quick check that your vector exists:

`curl -s http://localhost:8080/v1/schema | jq '.classes[] | select(.class=="Article") .vectorConfig' `

Look for `"embedding_text_vector"` in the output.

I couldn’t find an open ticket for this in `weaviate/weaviate-ts-client`, so it’s probably worth filing one. @DudaNogueira could you confirm this is a missing feature? If so, I’m happy to open the issue so it can get picked up in the next 3.8.x patch.

---

<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:** [September 9, 2025, 2:12pm UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/3 "2025-09-09T14:12:11Z")

</div>

Hi there my friends!!

I was setting up a reproducible code in python, and I think there is something here 😬

I was able to group by a text array while performing a **near text** , but not with a **hybrid**.

here is a MRE (minimum reproducible example)

Client: 4.16.9, Server: 1.32.7

```python
import weaviate, os
from weaviate import classes as wvc

headers = {
    "X-OpenAI-Api-Key": os.getenv("OPENAI_APIKEY"),
}
client = weaviate.connect_to_local(
    headers=headers,
)
print(f"Client: {weaviate. __version__ }, Server: {client.get_meta().get('version')}")

client.collections.delete("Test")
collection = client.collections.create(
    "Test",
    vector_config=[
        wvc.config.Configure.Vectors.text2vec_openai(
            name="my_named_vector",
            source_properties=["title"],
        )
    ]
)
collection.data.insert({"title": "a dog can bark loud", "tags": ["t1", "t2", "t3"], "tag": "tag1"})
collection.data.insert({"title": "a cat cannot bark", "tags": ["t2", "t3", "t4"], "tag": "tag2"})
collection.data.insert({"title": "The lion is the king of the forest", "tags": ["t3", "t4", "t5"], "tag": "tag3"})
collection.data.insert({"title": "Something about giraffes", "tags": ["t5"], "tag": "tag4"})

# near text can aggregate with a text array
# results = collection.query.near_text(
# hybrid cannot
results = collection.query.hybrid(
    #include_vector=True,
    query="bark forest",
    group_by=wvc.query.GroupBy(prop="tags", objects_per_group=10, number_of_groups=10),
    target_vector="my_named_vector",
    limit=50,
)
#print("results", results)
for group_name, group in results.groups.items():
    print(f"### {group_name}")
    for o in group.objects:
        print(f" - {o.properties.get('title')}")

```

this is the output I get for the near text query:

```bash
### t1
 - a dog can bark loud
### t2
 - a dog can bark loud
 - a cat cannot bark
### t3
 - a dog can bark loud
 - a cat cannot bark
 - The lion is the king of the forest
### t4
 - a cat cannot bark
 - The lion is the king of the forest
### t5
 - The lion is the king of the forest
 - Something about giraffes

```

I have poked around internally, and will update it here, as we may be facing two different issues here.

grouping by a `tag` property worked as expected.

Thanks!!

---

<div class="post-metadata">

**Author:** ![Chaitanya\_Kulthe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/chaitanya_kulthe/32/7546_2.png) [@Chaitanya\_Kulthe](https://forum.weaviate.io/u/Chaitanya_Kulthe)\
**Post date:** [September 9, 2025, 2:41pm UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/4 "2025-09-09T14:41:32Z")

</div>

Thanks a ton for spinning up the MRE! 🚀

Your Python run matches exactly what I was seeing on JS:

✅ groupBy works fine with nearText

❌ The moment we switch to hybrid, grouping breaks even with a valid targetVector

That ties back to the earlier gRPC error (no vector index for target vector “”) I hit on the JS client. So looks like it’s not just a client quirk the server doesn’t fully handle groupBy + hybrid together yet.

I’ll go ahead and open a GitHub issue in the main weaviate/weaviate repo and include:

groupBy passes with nearText but fails with hybrid (tested on 1.32.7)

Your Python repro snippet

Confirmation that it breaks on both JS (3.8.x) and Python (4.16.9), which points to a server-side gap

Once the ticket’s up I’ll drop the link here so we can track it together. Really appreciate you testing this so quickly

---

<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:** [September 9, 2025, 3:11pm UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/5 "2025-09-09T15:11:41Z")

</div>

Awesome!!!

Thanks for your contributions!!

After an initial analysis from our core team, it indeed points to a bug 😀  
and yes, we love finding new 🐛

😎

---

<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:** [September 9, 2025, 4:25pm UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/6 "2025-09-09T16:25:32Z")

</div>

Hey! We have a WIP PR

> <https://github.com/weaviate/weaviate/pull/9146>
>
> \### What's being changed:
> 
> Looks like if the property values(used for grouping…) are "list" or "slices" instead of plain string, \[we skip the grouping\](https://github.com/weaviate/weaviate/blob/150ce068cc27c37259c80fb8f5e8a9d75a4c2c2b/usecases/traverser/hybrid\_group\_by.go?plain=1#L30-L35). e.g: expecting \`tags: t1\` and fails if \`tags: \[t1, t2, t3\]\`
> 
> Example:
> \`\`\`
> collection.data.insert({"title": "Something about giraffes", "tags": \["t5"\], "tag": "tag4"})
> collection.data.insert({"title": "a cat cannot bark", "tags": \["t2", "t3", "t4"\], "tag": "tag2"})
> collection.data.insert({"title": "The lion is the king of the forest", "tags": \["t3", "t4", "t5"\], "tag": "tag3"})
> collection.data.insert({"title": "Something about giraffes", "tags": \["t5"\], "tag": "tag4"})
> 
> 
> results = collection.query.hybrid(
> #include\_vector=True,
> query="bark forest",
> group\_by=wvc.query.GroupBy(prop="tag", objects\_per\_group=10, number\_of\_groups=10),
> target\_vector="my\_named\_vector",
> limit=50,
> )
> \`\`\`
> 
> In your above code, if you change the GroupBy from prop=\`tags\` -\> prop=\`tag\`, the grouping works.
> 
> In near\_text search.
> We parse the group by property form the objects and if it's list, \[we consider each value of the list\](https://github.com/weaviate/weaviate/blob/150ce068cc27c37259c80fb8f5e8a9d75a4c2c2b/adapters/repos/db/shard\_group\_by.go?plain=1#L110-L129) (unlike hybrid search). 
> 
> \### Review checklist
> 
> \- \[\] Documentation has been updated, if necessary. Link to changed documentation:
> \- \[\] Chaos pipeline run or not necessary. Link to pipeline:
> \- \[\] All new code is covered by tests where it is reasonable.
> \- \[\] Performance tests have been run or not necessary.

---

<div class="post-metadata">

**Author:** ![pawwi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/pawwi/32/3900_2.png) [@pawwi](https://forum.weaviate.io/u/pawwi)\
**Post date:** [September 10, 2025, 2:04am UTC](https://forum.weaviate.io/t/group-by-using-hybrid-search-js-client/21955/7 "2025-09-10T02:04:51Z")

</div>

Thanks @Chaitanya_Kulthe and @DudaNogueira for digging into this so quickly! 🙏

That clears things up for me, it’s good to know the issue isn’t with my schema or client usage, but rather that `groupBy` + `hybrid` isn’t fully supported yet. I’ll keep an eye on the linked PR and test again once it lands in a release.

In the meantime, I’ll fall back to `nearText` or GraphQL aggregate queries for grouping. Really appreciate the MREs and confirmation across both JS and Python clients, makes it much easier to follow along.

Looking forward to the fix!
