/// <inheritdoc />
        public async Task <bool> IsValidIndexAsync <TEntity>(CancellationToken cancellation)
        {
            var info  = GetEntityInfo <TEntity>();
            var index = await GetIndexAsync(info, cancellation);

            if (index == null)
            {
                return(false);
            }

            var fields = new FieldBuilder().Build(typeof(TEntity));

            if (fields.Count != index.Fields.Count)
            {
                return(false);
            }

            return(fields.All(f => Compare(f, index.Fields.SingleOrDefault(i => i.Name == f.Name))));
        }