Exemple #1
0
        public ActionResult RTESearchQuery(
            Dictionary <string, string[]> tagParameters,
            Dictionary <string, string[]> rangeParameters,
            int gender,
            int glasses,
            int size,
            string language,
            string db,
            int page,
            int pageLength)
        {
            List <ICognitiveImageSearchResult> csr = Searcher.GetMediaResults(
                tagParameters,
                rangeParameters,
                gender,
                glasses,
                size,
                language,
                db);

            var skipCount = (page - 1) * pageLength;
            var trimList  = csr.Skip(skipCount).Take(pageLength);

            return(Json(new
            {
                Results = trimList.Select(r => MediaSearchFactory.CreateMediaSearchJsonResult(DataWrapper, r)),
                ResultCount = csr.Count
            }));
        }
        public ActionResult RTESearchQuery(
            Dictionary <string, string[]> tagParameters,
            Dictionary <string, string[]> rangeParameters,
            int gender,
            int glasses,
            int size,
            string language,
            List <string> colors,
            string db,
            int page,
            int pageLength)
        {
            if (!IsSitecoreUser())
            {
                return(new EmptyResult());
            }

            List <ICognitiveImageSearchResult> csr = SearchService.GetFilteredCognitiveSearchResults(
                tagParameters,
                rangeParameters,
                gender,
                glasses,
                size,
                language,
                colors,
                db);

            var skipCount = (page - 1) * pageLength;
            var trimList  = csr.Skip(skipCount).Take(pageLength);

            return(Json(new
            {
                Results = trimList.Select(r => MediaSearchFactory.CreateMediaSearchJsonResult(DataWrapper, r)),
                ResultCount = csr.Count
            }));
        }