Hi. I’m working my way through the code in Weaviate Academy and the hybrid search code is incomplete. For this code:
# Perform query
response = movies.query.hybrid(
query="history", # For BM25 part of the hybrid search
vector=query_vector, # For vector part of the hybrid search
limit=5,
return_metadata=wq.MetadataQuery(score=True),
)
Python throws and error that query_vector is undefined. Both Llama 4 and Gemini 2.5 Pro (experimental) fixed but I thought you should know.
Hi @Ken_Chang !!
Welcome to our community 
Indeed. There is a missing line for that lesson on using custom vectors for hybrid search:
query_text = "history"
query_vector = vectorize(co, [query_text])[0]
With that you can perform the query:
# Perform query
response = movies.query.hybrid(
query=query_text, # For BM25 part of the hybrid search
vector=query_vector, # For vector part of the hybrid search
limit=5,
return_metadata=wq.MetadataQuery(score=True),
)
I will make sure to send a PR for this later today.
Thanks for pointing it out!