def create_index(es_object, index_name, mappings=None, n_shards=1, n_replicas=0):
    """ Create an index if it does not exists yet. """
    is_created = False

    settings = {
        'settings': {
            'number_of_shards': n_shards,
            'number_of_replicas': n_replicas
        },
        'mappings': mappings
    }

    try:
        if not es_object.indices.exists(index_name):
            es_object.indices.create(index=index_name, ignore=400, body=settings)  # Ignore 400 "Index Already Exist" error
            print(f'Created Index: {index_name}')
        is_created = True
    except Exception as e:
        print(f'Failed to create index: {e}')
    finally:
        return is_created