code: def load_and_search(prefix, replicas=1):
      logger.info("search data starts")
      col_list = get_collections(prefix)
      for col_name in col_list:
          c = Collection(name=col_name)
          logger.info(f"collection name: {col_name}")
          logger.info("load collection")
          if replicas == 1:
              t0 = time.time()
              c.load()
              logger.info(f"load time: {time.time() - t0:.4f}")
          if replicas > 1:
              logger.info(
                  "release collection before load if replicas > 1"
              )
              t0 = time.time()
              c.release()
              logger.info(f"release time: {time.time() - t0:.4f}")
              t0 = time.time()
              c.load(replica_number=replicas)
              logger.info(f"load time: {time.time() - t0:.4f}")
              logger.info(c.get_replicas())
          topK = 5
          vectors = [[1.0 for _ in range(128)] for _ in range(3000)]
          index_name = col_name.replace(prefix, "")
          search_params = gen_search_param(index_name)[0]
          logger.info(search_params)
          # search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
          start_time = time.time()
          logger.info(f"\nSearch...")
          # define output_fields of search result
          v_search = vectors[:1]
          res = c.search(
              v_search,
              "float_vector",
              search_params,
              topK,
              "count > 500",
              output_fields=["count", "random_value"],
              timeout=120,
          )
          end_time = time.time()
          # show result
          for hits in res:
              for hit in hits:
                  logger.info(f"hit: {hit}")
              ids = hits.ids
              assert (
                  len(ids) == topK
              ), f"get {len(ids)} results, but topK is {topK}"
              logger.info(ids)
          assert len(res) == len(
              v_search
          ), f"get {len(res)} results, but search num is {len(v_search)}"
          logger.info("search latency: %.4fs" % (end_time - start_time))
          t0 = time.time()
          expr = "count in [2,4,6,8]"
          if "SQ" in col_name or "PQ" in col_name:
              output_fields = ["count", "random_value"]
          else:
              output_fields = ["count", "random_value", "float_vector"]
          res = c.query(expr, output_fields, timeout=120)
          sorted_res = sorted(res, key=lambda k: k["count"])
          for r in sorted_res:
              logger.info(r)
          t1 = time.time()
          assert len(res) == 4
          logger.info("query latency: %.4fs" % (t1 - t0))
          # c.release()
          logger.info("###########")
      logger.info("search data ends")
  
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 8 for calling a global function with example usage: load_and_search(prefix, replicas) without return types