def _create_index_if_required(self) -> None:
        """
        Create the index based on the index management strategy.

        This method only create index for existing collection without index.
        """
        if self.index_management == IndexManagement.NO_VALIDATION:
            return
        elif self.index_management == IndexManagement.CREATE_IF_NOT_EXISTS:
            if len(self.client.list_indexes(self.collection_name)) > 0:
                return
            else:
                index_params = self.client.prepare_index_params()
                if self.enable_dense:
                    index_params = self._add_dense_index_params(index_params)
                if self.enable_sparse:
                    index_params = self._add_sparse_index_params(index_params)
                self.client.create_index(self.collection_name, index_params)
                logger.debug(
                    f"Successfully created index for existing collection: {self.collection_name}"
                )
        else:
            logger.warning(
                f"Ignored unsupported index management strategy: {self.index_management}"
            )
            return

        Create the index based on the index management strategy.

        This method only create index for existing collection without index.
        
llama-index-integrations/vector_stores/llama-index-vector-stores-milvus/llama_index/vector_stores/milvus/base.py