예제 #1
0
        public SearchResult Search(dynamic query, string contentType = null, int skip = 0, int take = 20, string sort = "$created:desc")
        {
            JObject reduceObj = query as JObject ?? JObject.FromObject(query);

            ISearchResult result = index.Search(reduceObj).Skip(skip).Take(take);

            if (!string.IsNullOrEmpty(sort))
            {
                result.Sort(CreateSortObject(sort));
            }
            SearchResult searchResult = new SearchResult(result);

            return(searchResult);
        }