Esempio n. 1
0
        static IEnumerable <SearchResult> DoSearch(List <string[]> requests, DemoProductModel product)
        {
            var results = new List <SearchResult>();

            if (product.Overview != null)
            {
                results.AddRange(GetRes(requests, product.Overview, string.Format("{0}", SearchAgregator.HighlightOccurences(product.NavItemTitle, requests, true)), product.Overview.Product.Title.ToUpper()));
            }
            foreach (var group in product.Groups)
            {
                foreach (var demo in group.Demos)
                {
                    results.AddRange(GetRes(requests, demo, string.Format("{0}", SearchAgregator.HighlightOccurences(demo.Title, requests, true)), demo.Product.Title.ToUpper()));
                }
            }
            return(results);
        }
Esempio n. 2
0
        static IEnumerable <BootstrapSearchResult> DoSearch(List <string[]> requests, BootstrapDemoGroupPageModel group)
        {
            var results = new List <BootstrapSearchResult>();

            foreach (var demo in group.Demos)
            {
                foreach (var section in demo.Sections)
                {
                    results.AddRange(GetRes(requests, demo, section, SearchAgregator.HighlightOccurences(section.Title, requests)));
                }
                if (results.Count == 0)
                {
                    results.AddRange(GetRes(requests, demo, null, SearchAgregator.HighlightOccurences(demo.Title, requests)));
                }
            }
            results.AddRange(GetRes(requests, group, null, SearchAgregator.HighlightOccurences(group.Title, requests)));
            return(results);
        }