Ejemplo n.º 1
0
        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));
     }
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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));
 }