You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: search.rb
    path of file: ./repos/boxcars/lib/boxcars/vector_store/hnswlib
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'hnswlib'
require 'json'

module Boxcars
  module VectorStore
    module Hnswlib
      class Search
 
    
        def load_index(metadata, index_file)
          search_index = ::Hnswlib::HierarchicalNSW.new(
            space: metadata[:metric],
            dim: metadata[:dim]
          )
          search_index.load_index(index_file)
          search_index
        end