Find answers from the community

Updated 2 years ago

Did the way to call the hybrid search in Weaviate change?raise ValueError(f"Invalid quer

@kapa.ai
Did the way to call the hybrid search in Weaviate change?

raise ValueError(f"Invalid query mode: {query.mode}")
ValueError: Invalid query mode: VectorStoreQueryMode.HYBRID
k
2 comments
Please stand by @Daslav as I search the knowledge base. We are experiencing especially high traffic right now and might take longer than usual. :wave:
----------------------
Yes, the way to call the hybrid search in Weaviate has changed. You can use the hybrid search by setting the vector_store_query_mode parameter to "hybrid" when creating the query engine. The alpha parameter can be used to adjust the weighting between bm25 and vector search (alpha = 0 -> bm25, alpha = 1 -> vector search). By default, alpha=0.75 is used.

Here's an example of how to call the hybrid search in Weaviate:

Plain Text
query_engine = index.as_query_engine(
    vector_store_query_mode="hybrid", 
    similarity_top_k=2
)
response = query_engine.query(
    "What did the author do growing up?", 
)


You can find more information about this in the Weaviate Vector Store - Hybrid Search (https://gpt-index.readthedocs.io/en/latest/examples/vector_stores/WeaviateIndexDemo-Hybrid.html) section of the documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord