public void StartScroll() { ElasticsearchScroll scroll; scroll = new ElasticsearchScroll(); scroll.KeepAlive = 1; GetElasticsearch().StartScroll(null, scroll); Assert.IsTrue(scroll.ScrollId.IsNotEmpty()); }
/// <summary> /// Get species observations that matches filter. /// This method returns next documents in the scroll in an effecient way. /// </summary> /// <param name="filter">Filter for species observations.</param> /// <param name="scroll">Information about the scroll.</param> /// <returns>Species observations in JSON format.</returns> public DocumentFilterResponse GetSpeciesObservations(String filter, ElasticsearchScroll scroll) { if (scroll.ScrollId.IsEmpty()) { return(StartScroll(filter, scroll)); } else { return(GetScroll(scroll)); } }
public void GetScroll() { DocumentFilterResponse documentFilterResponse; ElasticsearchScroll scroll; scroll = new ElasticsearchScroll(); scroll.KeepAlive = 1; GetElasticsearch().StartScroll(null, scroll); Assert.IsTrue(scroll.ScrollId.IsNotEmpty()); documentFilterResponse = GetElasticsearch().GetScroll(scroll); Assert.IsTrue(scroll.ScrollId.IsNotEmpty()); Assert.IsNotNull(documentFilterResponse); Assert.IsTrue(documentFilterResponse.DocumentsJson.IsNotEmpty()); }
public void GetSpeciesObservationsByScroll() { DocumentFilterResponse documentFilterResponse; ElasticsearchScroll scroll; scroll = new ElasticsearchScroll(); scroll.KeepAlive = 1; for (Int32 index = 0; index < 5; index++) { documentFilterResponse = GetElasticsearch().GetSpeciesObservations(null, scroll); Assert.IsTrue(scroll.ScrollId.IsNotEmpty()); Assert.IsNotNull(documentFilterResponse); Assert.IsTrue(documentFilterResponse.DocumentsJson.IsNotEmpty()); } }
/// <summary> /// Start scroll of documents that matches search criteria. /// </summary> /// <param name="filter">Filter for species observations.</param> /// <param name="scroll">Information about the scroll.</param> /// <returns>The first set of species observation.</returns> public DocumentFilterResponse StartScroll(String filter, ElasticsearchScroll scroll) { return(StartScroll(SpeciesObservationType, filter, scroll)); }