How do I get the vectors returned with the hybrid search results?

Description

I would like the vectors returned with the search results.

I am doing this:

            client.connect()
            try:
                collection = client.collections.get("mycollection")
                docs = collection.query.hybrid(
                    query=query,
                    alpha=0.75,
                    return_metadata=wvc.query.MetadataQuery(score=True),
                    limit=k,
                    query_properties=['CONTENT'],
                ).objects
docs]
            finally:
                client.close()

Server Setup Information

  • Weaviate Server Version: 1.24.2
  • Deployment Method: Docker
  • Multi Node? Number of Running Nodes: 1
  • Client Language and Version: Python, 4.5.3

Any additional Information

Hi,

if you mean the vectors of the objects, you can do

            client.connect()
            try:
                collection = client.collections.get("mycollection")
                docs = collection.query.hybrid(
                    query=query,
                    alpha=0.75,
                    return_metadata=wvc.query.MetadataQuery(score=True),
                    limit=k,
                    include_vector=True,
                    query_properties=['CONTENT'],
                ).objects
docs]
            finally:
                client.close()
1 Like