milvus: Search (collection.search) is not working from saved collection

I am trying to use the saved collection for doing a search but collection.search()stuck and not responding.

Description I have created a collection named sentence_only_vector I have created two field schema

  1. id_field : where is_primary=True and auto_id=False
  2. embedding: where my embedding created using distilbert model separately, with dims=768 in total I have ~ 11 000 vectors

Steps/Code to reproduce behavior

  1. created ~11000 vectors sized 768 data shape is [11000 x 768] and ids which are int (no negative ints)
  2. Then I used collection.insert([ids, sentence_only_vectors])
  3. I created an index with the following params: index_param = { "metric_type":"L2", "index_type":"IVF_FLAT", "params":{"nlist":50} } field_name = 'embedding' collection.create_index(field_name=field_name, index_params=index_param)
  4. search part
  collection.load()
  search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
  results = collection.search([sentence_vectors[0]], field_name, param=search_params, limit=10, expr=None)

Till here everything works as expected. after this, I shut down everything, and later started the docker service and doing the following steps in order to search from saved collections (my assumption is, it will also load the FAISS index when we load collections using collection.load()).

  1. This is how I am loading it
collection = Collection(name='sentence_only_vector')
collection.load()

print(collection.schema)
>>> {"auto_id": false, "description": "desc of collection", "fields": [{"name": "id", "description": "ids of the vectors", "type": 5, "is_primary": true, "auto_id": false}, {"name": "embedding", "description": "", "type": 101, "params": {"dim": 768}}]}

[When I run the following, I am not getting any output kind of code stuck here ]
* results = collection.search(sentence_vectors[:5], field_name, param=search_params, limit=10, expr=None)

Expected behavior A clear and concise description of what you expected to happen.

Method of installation

  • Docker/cpu
  • Docker/gpu
  • Build from source

Environment details

  • Hardware/Software conditions (OS, CPU, Memory) McOS BigSur, Memory: 8 GB 2133 MHz LPDDR3

  • Milvus version (2.0.0rc1)

Configuration file Settings you made in server_config.yaml or milvus.yaml no changes here

paste-file-content-here

This is the code for search Screenshot 2021-07-08 at 1 04 27 PM

**Apologies, if this is something else, **

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Restarting pulsar docker may cause this problem. We are looking for a solution to the issue. You can try not to restart the pulsar service first. @aquibjaved

thanks for the detailed input, /assign @xige-16 please take a look