module Jekyll::Algolia::Indexer

def self.update_settings(index)

users to configure them through their dashboard.
are defined in _config.yml. Otherwise, they are left untouched, allowing
Settings will only be updated in the first push, and if custom settings
Does nothing in dry run mode

index - The Algolia Index

Public: Update settings of the index
def self.update_settings(index)
  has_custom_settings = !Configurator.algolia('settings').nil?
  index_exists = index?(index.name)
  # No need to update the settings if the index is already configured and
  # the user did not specify custom settings
  return if index_exists && !has_custom_settings
  Logger.verbose('I:Updating settings')
  return if Configurator.dry_run?
  settings = Configurator.settings
  begin
    index.set_settings!(settings)
  rescue StandardError => error
    ErrorHandler.stop(error, settings: settings)
  end
end