code: def gen_search_param(index_type, metric_type="L2"):
      search_params = []
      if index_type in ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ"]:
          for nprobe in [10]:
              ivf_search_params = {
                  "metric_type": metric_type,
                  "params": {"nprobe": nprobe},
              }
              search_params.append(ivf_search_params)
      elif index_type in ["BIN_FLAT", "BIN_IVF_FLAT"]:
          for nprobe in [10]:
              bin_search_params = {
                  "metric_type": "HAMMING",
                  "params": {"nprobe": nprobe},
              }
              search_params.append(bin_search_params)
      elif index_type in ["HNSW"]:
          for ef in [64]:
              hnsw_search_param = {
                  "metric_type": metric_type,
                  "params": {"ef": ef},
              }
              search_params.append(hnsw_search_param)
      elif index_type == "ANNOY":
          for search_k in [1000]:
              annoy_search_param = {
                  "metric_type": metric_type,
                  "params": {"search_k": search_k},
              }
              search_params.append(annoy_search_param)
      else:
          logger.info("Invalid index_type.")
          raise Exception("Invalid index_type.")
      return search_params
  
file_path: milvus/tests/python_client/deploy/scripts/utils.py
imports: import sys
  import copy
  import time
  from loguru import logger
  import pymilvus
  from pymilvus import FieldSchema, CollectionSchema, DataType, Collection, list_collections
label_desc: Use image node_id 2 for calling a global function with example usage: gen_search_param(index_type, metric_type) and returns: search_params