public async Task <IReadOnlyCollection <T> > FetchQuotes <T>(string Symbol, DateTime Start, DateTime End) where T : class, IDataRow, new() { List <T> documents = new List <T>(); var search = await _client.SearchAsync <T>(s => s .AllTypes() .From(0) .Size(10000) .Query(q => q .Match(m => m .Field(new Field("baseSymbol")) .Query(Symbol) ) && q .DateRange(r => r .Field(f => f.date) .GreaterThanOrEquals(Start) .LessThanOrEquals(End) ) ) .Scroll(100) ); //first page string scrollId = search.ScrollId; documents.AddRange(search.Documents); ISearchResponse <T> results; do { //page until we get all the results results = await _client.ScrollAsync <T>(100, scrollId); scrollId = results.ScrollId; documents.AddRange(results.Documents); } while (results.Documents.Count == 10000); this.Log("Retrieved {0} document objects.", documents.Count); return(documents); }