# Query Across multiple classes

**URL:** <https://forum.weaviate.io/t/query-across-multiple-classes/2872>\
**Category:** General\
**Created:** [June 30, 2024, 2:16pm UTC](https://forum.weaviate.io/t/query-across-multiple-classes/2872 "2024-06-30T14:16:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 1, 2024, 7:48pm UTC](https://forum.weaviate.io/t/query-across-multiple-classes/2872/2 "2024-07-01T19:48:22Z")

</div>

hi @Ansh_Gaur !

Welcome to our community 🤗

Unless you use [cross references](https://weaviate.io/developers/weaviate/manage-data/cross-references) (and maybe [ref2vec](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/ref2vec-centroid)?) and some modelling, you will not be able to query the two collections at once and get a single score/distance.

You will, off course, be able to get two+ separate queries, as you are doing.

Now, you need to keep in mind that, when doing a **hybrid** search, the [fusion algorithm](https://weaviate.io/blog/hybrid-search-fusion-algorithms) will kick in.

So you are not resorting the two queries results by cosine vector distance, but by a normalized score ranking from the first result on each query (the score of the first object in each query is 1), as explained in that blog post.

Maybe the distance (or doing a nearText with outcut instead of hybrid) can get you better different sorting. Or not hehehe

So something to explore 🙂

Also, I see you are using the v3 client. We strongly suggest using the python v4 client.

With that said… 😉 there is a way of getting the two results with only one http query, by using graphql raw queries 🙂

Check here for more on that:

> [@GraphQL: Use Common Interface for Classes](https://forum.weaviate.io/t/graphql-use-common-interface-for-classes/726/2):
>
> Hi @Tobias_Schweizer ! Welcome to our community hugs Happy to know that you are experimenting and liking Weaviate! AFAIK, there isn’t a way to implement such an Interface. While you can use [cross reference to create relationships between those classes](https://weaviate.io/developers/weaviate/manage-data/cross-references), you will need to query each class with it’s properties separately. There is a way to do multiple queries at the same request payload by leveraging GraphQL alias, like so: { Get { Q1: MyClass(tenant: "rep-1") { name } …

Let me know if that helps 🙂

---

_[View the full topic](https://forum.weaviate.io/t/query-across-multiple-classes/2872)._
