module Jekyll::Algolia::Indexer

def self.index_exist?(index)

instead, which will fail if the index does not exist
Note: there is no API endpoint to do that, so we try to get the settings

index - Index to check

Public: Check if an index exists
def self.index_exist?(index)
  index.get_settings
  true
rescue StandardError
  false
end