docstr: target: test compact during search
  method: while compact collection start a thread to search
  expected: No exception
docstr_tok: ["target",":","test","compact","during","search","method",":","while","compact","collection","start","a","thread","to","search","expected",":","No","exception"]
code: def test_compact_during_search(self):
      """
      target: test compact during search
      method: while compact collection start a thread to search
      expected: No exception
      """
      # less than auto-merge threshold 10
      num_of_segment = ct.compact_segment_num_threshold - 1
  
      # create collection shard_num=1, insert 11 segments, each with one entity
      collection_w = self.collection_insert_multi_segments_one_shard(
          prefix, num_of_segment=num_of_segment, nb_of_segment=100
      )
  
      def do_search():
          for _ in range(5):
              search_res, _ = collection_w.search(
                  cf.gen_vectors(1, ct.default_dim),
                  ct.default_float_vec_field_name,
                  ct.default_search_params,
                  ct.default_limit,
              )
              assert len(search_res[0]) == ct.default_limit
  
      # compact during search
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      collection_w.load()
      t = threading.Thread(target=do_search, args=())
      t.start()
  
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans(
          check_task=CheckTasks.check_merge_compact,
          check_items={"segment_num": num_of_segment},
      )
      t.join()
  
imports: import threading
  from time import time, sleep
  import pytest
  from pymilvus.grpc_gen.common_pb2 import SegmentState
  from pymilvus.exceptions import MilvusException
  from base.client_base import TestcaseBase
  from common import common_func
  from common import common_type
  from common.common_type import CaseLabel, CheckTasks
  from utils.util_log import test_log
label_desc: Use image node_id 25 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_during_search() without return types