You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<LOCAL-PATH>\test_milvus_bm25.py", line 145, in <module>
results = client.hybrid_search(
collection_name="demo",
...<2 lines>...
limit=3
)
File "<LOCAL-PATH>\.venv\Lib\site-packages\pymilvus\milvus_client\milvus_client.py", line 359, in hybrid_search
ret.append([hit.to_dict() for hit in hits])
^^^^
TypeError: 'SequenceIterator' object is not iterable
This is what I changed on milvus client code to make it work:
From:
try:
res = conn.hybrid_search(
collection_name,
reqs,
ranker,
limit=limit,
partition_names=partition_names,
output_fields=output_fields,
timeout=timeout,
**kwargs,
)
except Exception as ex:
logger.error("Failed to hybrid search collection: %s", collection_name)
raise ex from ex
ret = []
for hits in res:
ret.append([hit.to_dict() for hit in hits])
return ExtraList(ret, extra=construct_cost_extra(res.cost))
To:
try:
res = conn.hybrid_search(
collection_name,
reqs,
ranker,
limit=limit,
partition_names=partition_names,
output_fields=output_fields,
timeout=timeout,
**kwargs,
)
except Exception as ex:
logger.error("Failed to hybrid search collection: %s", collection_name)
raise ex from ex
ret = []
for hits in res:
ret.append([hit.to_dict() for hit in list(hits)]) #added list() method
return ExtraList(ret, extra=construct_cost_extra(res.cost))
And it now works without throwing the error.
Is any of my dependencies missmatching or is the hybrid search code on the client bricked for this version?
Steps To Reproduce
1. Perform a Hybrid Search (I wasn't able to perform it in any way I tried)
Is there an existing issue for this?
Current Behavior
I want to perform a weighted BM25 search and the milvus_client code is throwing an error
Currently using 2.5.4 python sdk and milvus standalone, I've posted the docker compose and python version below under "Software version"
This is my code for searching the indexes with BM25, that individually work but errors with hybrid_search:
Error Trace:
This is what I changed on milvus client code to make it work:
From:
To:
And it now works without throwing the error.
Is any of my dependencies missmatching or is the hybrid search code on the client bricked for this version?
Steps To Reproduce
Software version
The text was updated successfully, but these errors were encountered: