Ejemplo n.º 1
0
        public void PerformAnalytics(TabItem tab, AnalyticsParameters parameters)
        {
            Assert.ArgumentNotNull(tab, nameof(tab));
            Assert.ArgumentNotNull(parameters, nameof(parameters));

            // Init Query
            var args = new SearchAnalyticsArgs
            {
                TabItem          = tab,
                SearchParameters = parameters.SearchParameters ?? new SearchParameters(),
                SearchResponse   = parameters.SearchResponse ?? new SearchResponse()
            };

            CorePipeline.Run(Pipeline.SearchAnalytics, args);
        }
        public ActionResult Analytics(AnalyticsParameters parameters)
        {
            Item   tabItem = null;
            string errMsg;
            var    db = Sitecore.Context.ContentDatabase ?? Sitecore.Context.Database;

            if (parameters.SearchParameters != null)
            {
                var searchParams = parameters.SearchParameters;
                if (!TryGetTabById(searchParams.TabId, db, out tabItem, out errMsg))
                {
                    return(Content(errMsg));
                }
                if ((searchParams.SelectedFacets == null || searchParams.SelectedFacets.Count() == 0) && !string.IsNullOrEmpty(searchParams.SelectedFacetsRaw))
                {
                    searchParams.SelectedFacets = ParseFacets(searchParams.SelectedFacetsRaw);
                }
                parameters.SearchParameters = searchParams;
            }

            NimbleService.PerformAnalytics(tabItem, parameters);

            return(Content("done"));
        }
 // Redirects request to "Index" view
 public IActionResult Filter(AnalyticsParameters myParams)
 {
     return(View("Index"));
 }