public class Animal
{
public const string SearchIndex = "animals";
public int Id { get; set; }
public string AnimalType { get; set; }
public string TypeSpecificForAnimalType { get; set; }
public string Description { get; set; }
public string Gender { get; set; }
public string LastLocation { get; set; }
}
private void ValidateIfIdIsAlreadyUsedForIndex(string id)
{
var idsList = new List<string> { id };
var result = _elasticsearchClient.Search<Animal>(s => s
.Index("animals")
.AllTypes()
.Query(p => p.Ids(idsList)));
if (result.Documents.Any()) throw new ArgumentException("Id already exists in store");
}
I am using nest version 5.0.0.0 and error i am getting
cannot convert from 'System.Collections.Generic.List' to 'System.Func<Nest.IdsQueryDescriptor,Nest.IIdsQuery>'