class_docstr: test other interface that has db_name params
class_docstr_tok: ["test","other","interface","that","has","db_name","params"]
docstr: target: test search with db
  method: 1. create collection in a db
          2. search with expr on some partitions
          3. search with output_fields
          4. search output vector field and ignore growing
          5. search with pagination
          6. range search (filter with radius)
          7. search iterator
  expected: no error
docstr_tok: ["target",":","test","search","with","db","method",":","1.","create","collection","in","a","db","2.","search","with","expr","on","some","partitions","3.","search","with","output_fields","4.","search","output","vector","field","and","ignore","growing","5.","search","with","pagination","6.","range","search","(","filter","with","radius",")","7.","search","iterator","expected",":","no","error"]
code: def test_search_db(self):
      """
      target: test search with db
      method: 1. create collection in a db
              2. search with expr on some partitions
              3. search with output_fields
              4. search output vector field and ignore growing
              5. search with pagination
              6. range search (filter with radius)
              7. search iterator
      expected: no error
      """
      # prepare data:
      #  1. create collection with pk_field + vector_field, enable dynamic field
      #  2. insert [0, nb) into default partition and flush
      #  3. create index and load
      #  4. insert data with dynamic extra field into new partition, pk from [nb, 2*nb)
      _, partition_name = self.prepare_data_for_db_search()
  
      query_vec = cf.gen_vectors(ct.default_nq, ct.default_dim)
  
      # search with dynamic field expr and from partition
      self.collection_wrap.search(
          data=query_vec,
          anns_field=ct.default_float_vec_field_name,
          param=ct.default_search_params,
          limit=ct.default_limit,
          expr=f"{ct.default_int64_field_name} < 2800 or {ct.default_int8_field_name} > 500",
          partition_names=[ct.default_partition_name],
          check_task=CheckTasks.check_search_results,
          check_items={"nq": ct.default_nq, "limit": ct.default_limit},
      )
  
      # search with output pk + dynamic fields
      ignore_growing_search_params = {
          "metric_type": "COSINE",
          "params": {"nprobe": 10},
          "ignore_growing": True,
      }
      search_res, _ = self.collection_wrap.search(
          data=query_vec,
          anns_field=ct.default_float_vec_field_name,
          param=ignore_growing_search_params,
          limit=ct.default_limit,
          output_fields=[
              ct.default_int64_field_name,
              ct.default_string_field_name,
          ],
          check_task=CheckTasks.check_search_results,
          check_items={"nq": ct.default_nq, "limit": ct.default_limit},
      )
      assert ct.default_int64_field_name in set(
          search_res[0][0].entity.fields
      )
  
      # search with output vector fields and ignore growing
      ignore_growing_search_params = {
          "metric_type": "COSINE",
          "params": {"nprobe": 10},
          "ignore_growing": False,
      }
      self.collection_wrap.search(
          data=query_vec,
          anns_field=ct.default_float_vec_field_name,
          param=ignore_growing_search_params,
          limit=ct.default_limit,
          output_fields=[
              ct.default_int64_field_name,
              ct.default_float_vec_field_name,
          ],
          check_task=CheckTasks.check_search_results,
          check_items={
              "nq": ct.default_nq,
              "limit": ct.default_limit,
              "output_fields": [
                  ct.default_int64_field_name,
                  ct.default_float_vec_field_name,
              ],
          },
      )
  
      # search with pagination
      self.collection_wrap.search(
          data=query_vec,
          anns_field=ct.default_float_vec_field_name,
          param=ct.default_search_params,
          limit=ct.default_limit,
          offset=ct.default_limit,
          check_task=CheckTasks.check_search_results,
          check_items={"nq": ct.default_nq, "limit": ct.default_limit},
      )
  
      # range search
      range_search_params = {
          "metric_type": "COSINE",
          "params": {"radius": 0.0, "range_filter": 1000},
      }
      self.collection_wrap.search(
          query_vec,
          ct.default_float_vec_field_name,
          range_search_params,
          ct.default_limit,
          expr=None,
          check_task=CheckTasks.check_search_results,
          check_items={"nq": ct.default_nq, "limit": ct.default_limit},
      )
  
      # search iterator
      self.collection_wrap.search_iterator(
          query_vec[:1],
          ct.default_float_vec_field_name,
          ct.default_search_params,
          ct.default_limit * 100,
          partition_names=[partition_name],
          check_task=CheckTasks.check_search_iterator,
          check_items={"limit": ct.default_limit * 100},
      )
  
imports: import pandas
  import pytest
  from base.client_base import TestcaseBase
  from common.common_type import CheckTasks, CaseLabel
  from common import common_func
  from common import common_type
  from utils.util_log import test_log
label_desc: Use image node_id 7 for calling the TestDatabaseOtherApi obj's underlying member method code with example usage: obj.test_search_db() without return types