pymilvus icon indicating copy to clipboard operation
pymilvus copied to clipboard

[Bug]: search method is not responding

Open rajeevkri opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

from haystack latest code below code is calling pymilvus for searching in document `from pymilvus import connections

search_result: QueryResult = connection.search( collection_name=index, dsl=dsl, fields=[self.id_field], )`

This method call does not respond at all goes in infinite wait

Expected Behavior

It should respond with search result

Steps/Code To Reproduce behavior

run the below code 

`from pymilvus import connections

search_result: QueryResult = connection.search(
            collection_name=index,
            dsl=dsl,
            fields=[self.id_field],
        )`


If running from haystack 

run below code

`import os
from haystack.retriever.dense import EmbeddingRetriever
from haystack.pipeline import FAQPipeline

os.environ["MILVUS2_ENABLED"] = "1"
print(os.getenv("MILVUS2_ENABLED"))

from haystack.document_stores.milvus2x import Milvus2DocumentStore

document_store_faq = Milvus2DocumentStore(index="test_data", port = "19530",
vector_dim =384)

retriever_faq = EmbeddingRetriever(document_store=document_store_faq, embedding_model='sentence-transformers/all-MiniLM-L6-v2', use_gpu=True)

pipeline = FAQPipeline(retriever=retriever_faq)

search1 = pipeline.run(
query="What is the use of testing?"
)

print(search1)`
 to reproduce

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory):
- Method of installation (Docker, or from source): from operator
- Milvus version (v0.3.1, or v0.4.0): milvus 2
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

No response

rajeevkri avatar Dec 28 '21 04:12 rajeevkri

I'm also facing the same issue. Can anybody answer that?

vinith-reddy25 avatar Dec 28 '21 10:12 vinith-reddy25

Milvus 2.x doesn't support dsl anymore, we recommend use expression in search like https://github.com/milvus-io/pymilvus/blob/8ae48b8bab51f3ba7c1c10d8479f65a4a24da43d/examples/hello_milvus.py#L140

XuanYang-cn avatar Dec 29 '21 07:12 XuanYang-cn

HI @XuanYang-cn definition of method search is below from pymilvus repo @retry_on_rpc_failure(retry_times=10, wait=1) def search(self, collection_name, data, anns_field, param, limit, expression=None, partition_names=None, output_fields=None, timeout=None, round_decimal=-1, **kwargs): it does not include expr.

according to signature i changed the call to

search_result: QueryResult = connection.search( collection_name=index, data= query_emb.tolist(), anns_field= self.embedding_field, param=self.search_param, limit=10 )

But i still did not get response

rajeevkri avatar Dec 29 '21 09:12 rajeevkri