Relevant code/class info:
def init_hybrid_engine(self, k: int=3) -> BaseQueryEngine:
'''Initializes the hybrid engine for the vector store'''
hybrid_query_engine = self.index.as_query_engine(
vector_store_query_mode = 'hybrid'
, sparse_top_k=k
)
self.hybrid_query_engine = hybrid_query_engine
return hybrid_query_engine
def hybrid_search(self, query: str) -> list[dict]:
'''Performs a hybrid search on the vector store'''
if hasattr(self, 'hybrid_query_engine') == False:
self.init_hybrid_engine()
results = self.hybrid_query_engine.query(query)
return results
Comes from attached code.