docstr: target: test compact after delete and create index
  method: 1.create with 1 shard and insert nb entities (ensure can be index)
          2.delete some entities and flush (ensure generate delta log)
          3.create index
          4.compact outside retentionDuration
          5.load and search 
  expected: Empty search result
docstr_tok: ["target",":","test","compact","after","delete","and","create","index","method",":","1.create","with","1","shard","and","insert","nb","entities","(","ensure","can","be","index",")","2.delete","some","entities","and","flush","(","ensure","generate","delta","log",")","3.create","index","4.compact","outside","retentionDuration","5.load","and","search","expected",":","Empty","search","result"]
code: def test_compact_after_delete_index(self):
      """
      target: test compact after delete and create index
      method: 1.create with 1 shard and insert nb entities (ensure can be index)
              2.delete some entities and flush (ensure generate delta log)
              3.create index
              4.compact outside retentionDuration
              5.load and search
      expected: Empty search result
      """
      # create, insert without flush
      collection_w = self.init_collection_wrap(
          cf.gen_unique_str(prefix), shards_num=1
      )
      df = cf.gen_default_dataframe_data()
      insert_res, _ = collection_w.insert(df)
  
      # delete and flush
      expr = f"{ct.default_int64_field_name} in {insert_res.primary_keys[:ct.default_nb // 2]}"
      collection_w.delete(expr)
      assert collection_w.num_entities == ct.default_nb
  
      # build index
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      log.debug(collection_w.index())
  
      # compact, get plan
      sleep(ct.compact_retention_duration + 1)
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans(
          check_task=CheckTasks.check_delete_compact
      )
  
      collection_w.load()
      res, _ = collection_w.search(
          df[ct.default_float_vec_field_name][:1].to_list(),
          ct.default_float_vec_field_name,
          ct.default_search_params,
          ct.default_limit,
      )
      assert len(res[0]) == ct.default_limit
  
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 7 for calling the TestCompactionParams obj's underlying member method code with example usage: obj.test_compact_after_delete_index() without return types