Method: Algolia::Search::Client#copy_index

Defined in:
lib/algolia/search_client.rb

#copy_index(src_index_name, dest_index_name, opts = {}) ⇒ IndexingResponse

Copy the source index to the destination index

Parameters:

  • src_index_name (String)

    Name of the source index

  • dest_index_name (String)

    Name of the destination index

  • opts (Hash) (defaults to: {})

    contains extra parameters to send with your query

Returns:



216
217
218
219
220
# File 'lib/algolia/search_client.rb', line 216

def copy_index(src_index_name, dest_index_name, opts = {})
  response = @transporter.write(:POST, path_encode('/1/indexes/%s/operation', src_index_name), { operation: 'copy', destination: dest_index_name }, opts)

  IndexingResponse.new(init_index(src_index_name), response)
end