Beispiel #1
0
        public override List<SkinnyItem> GetItems(string indexName,
            string language,
            string templateFilter,
            string locationFilter,
            string fullTextQuery)
        {
            var searchParam = new SearchParam { Language = language,
                                             RelatedIds = RelationFilter,
                                             TemplateIds = templateFilter,
                                             LocationIds = locationFilter,
                                             FullTextQuery = fullTextQuery
             };

             using (var searcher = new Searcher(indexName))
             {
            return searcher.GetItems(searchParam);
             }
        }
        private List<SkinnyItem> GetItems(string indexName,
                                                  string language,
                                                  string templateFilter,
                                                  string locationFilter,
                                                  string fullTextQuery)
        {
            var searchParam = new SearchParam
            {
                Language = language,
                TemplateIds = templateFilter,
                LocationIds = locationFilter,
                FullTextQuery = fullTextQuery,
                ShowAllVersions = false
            };

            using (var searcher = new Searcher(indexName))
            {
                return searcher.GetItems(searchParam);
            }
        }
Beispiel #3
0
        //public virtual List<SkinnyItem> GetItemsViaTermQuery(string fieldName, string fieldValue)
        //{
        //   var query = new TermQuery(new Term(fieldName, fieldValue));
        //   return RunQuery(query, false);
        //}
        //public virtual List<SkinnyItem> GetItemsViaFieldQuery(string fieldName, string fieldValue)
        //{
        //   var query = new FieldQuery(fieldName, fieldValue);
        //   return RunQuery(query, false);
        //}
        public virtual List<SkinnyItem> GetItems(SearchParam param)
        {
            var globalQuery = new CombinedQuery();

             ApplyLanguageClause(globalQuery, param.Language);
             ApplyFullTextClause(globalQuery, param.FullTextQuery);
             ApplyRelationFilter(globalQuery, param.RelatedIds);
             ApplyTemplateFilter(globalQuery, param.TemplateIds);
             ApplyLocationFilter(globalQuery, param.LocationIds);

             return RunQuery(globalQuery, param.ShowAllVersions);
        }