search() public method

Get a search result from the server
public search ( LoklakSearchTerm q, int count = 100, string source = "cache", IList fields = null, int limit = -1, int timeZoneOffset = -1 ) : Task
q LoklakSearchTerm query term
count int the wanted number of results
source string the source for the search cache|backend|twitter|all
fields IList aggregation fields for search facets
limit int a limitation of number of facets for each aggregation
timeZoneOffset int offset applied on since:, until: and the date histogram
return Task
Ejemplo n.º 1
0
        public async Task search()
        {
            Loklak loklak = new Loklak();
            var st = new LoklakSearchTerm();
            st.terms = "loklak";
            //st.since = DateTime.Now;
            //st.until = DateTime.Now;
            //st.since.AddMonths(-2);
            var result = await loklak.search(st);
            var d = JObject.Parse(result);
            Assert.IsNotNull(d.Property("search_metadata"));
            Assert.IsTrue(((JArray)d.GetValue("statuses")).Count > 0);

        }