protected virtual List <SitecoreItem> Simple()
        {
            var searchParam = new SearchParam
            {
                FullTextQuery = TextBox1.Text
            };

            //var dateRange = new DateRangeSearchParam
            //{
            //    Language = Lang,
            //    TemplateIds = GetTemplates(FullTextQuery),
            //    LocationIds = LocationFilter,
            //    FullTextQuery = GetText(FullTextQuery),
            //    ShowAllVersions = false,
            //    Ranges = new List<DateRangeSearchParam.DateRangeField>()
            //                                     {
            //                                         new DateRangeSearchParam.DateRangeField("__Created",
            //                                                                                 Convert.ToDateTime(GetStartDate(FullTextQuery)),
            //                                                                                 Convert.ToDateTime(GetEndDate(FullTextQuery)))
            //                                     }


            //};

            using (var searcher = new ItemBucket.Kernel.Kernel.Util.IndexSearcher(IndexName))
            {
                return(searcher.GetItems(searchParam));
            }
        }
Esempio n. 2
0
        protected virtual List<SitecoreItem> GetItems()
        {
            var searchParam = new SearchParam
            {
                Language = Lang,
                TemplateIds = GetTemplates(FullTextQuery),
                LocationIds = LocationFilter,
                FullTextQuery = GetText(FullTextQuery),
                ShowAllVersions = false
            };

            //var dateRange = new DateRangeSearchParam
            //{
            //    Language = Lang,
            //    TemplateIds = GetTemplates(FullTextQuery),
            //    LocationIds = LocationFilter,
            //    FullTextQuery = GetText(FullTextQuery),
            //    ShowAllVersions = false,
            //    Ranges = new List<DateRangeSearchParam.DateRangeField>()
            //                                     {
            //                                         new DateRangeSearchParam.DateRangeField("__Created",
            //                                                                                 Convert.ToDateTime(GetStartDate(FullTextQuery)),
            //                                                                                 Convert.ToDateTime(GetEndDate(FullTextQuery)))
            //                                     }

            //};

            using (var searcher = new ItemBucket.Kernel.Kernel.Util.IndexSearcher(IndexName))
            {
                return searcher.GetItems(searchParam);
            }
        }
Esempio n. 3
0
        protected virtual List<SitecoreItem> GetItems(string term)
        {
            var searchParam = new SearchParam
            {
                Language = Lang,
                TemplateIds = "",
                LocationIds = LocationFilter,
                FullTextQuery = term,
                ShowAllVersions = false
            };

            using (var searcher = new IndexSearcher(IndexName))
            {
                return searcher.GetItems(searchParam);
            }
            //using (var searcher = new Searcher.Searcher(IndexName))
            //{
            //    return searcher.GetItemsInRange(dateRange);
            //}
        }
Esempio n. 4
0
        protected override Item[] GetItems(Item current)
        {
            Assert.ArgumentNotNull(current, "current");

            //Split the source from the DataSource field
            var values = StringUtil.GetNameValues(Source, '=', '&');
            //Split the field FieldsFilter
            var refinements = new SafeDictionary<string>();
            if (values["FieldsFilter"] != null)
            {
                var splittedFields = StringUtil.GetNameValues(values["FieldsFilter"], ':', ',');

                foreach (string key in splittedFields.Keys)
                {
                    refinements.Add(key, splittedFields[key]);
                }
            }

            var searchParam = new FieldValueSearchParam
            {
                Refinements = refinements,
                //LocationIds = values["LocationFilter"],
                LocationIds = SelectedDropTreeValue,
                TemplateIds = values["TemplateFilter"],
                FullTextQuery = values["FullTextQuery"],
                Occurance = QueryOccurance.Must,
                ShowAllVersions = false,
                Language = values["Language"]
            };

            //Execute the search
            using (var searcher = new IndexSearcher("buckets"))
            {
                var items = searcher.GetItems(searchParam);
                return SearchHelper.GetItemListFromInformationCollection(items).ToArray();
            }
        }