Exemplo n.º 1
0
        public PagingListDetails <Tag> Get(TagSearchFilter filter)
        {
            Expression <Func <Tag, bool> > conditions = x => true;

            if (!string.IsNullOrWhiteSpace(filter.TitleF))
            {
                conditions = conditions.And(x => x.Title.Contains(filter.TitleF));
            }
            return(_appUow.TagRepo.Get(conditions, filter, x => x.OrderByDescending(x => x.Title)));
        }
Exemplo n.º 2
0
 public virtual ActionResult Manage(TagSearchFilter filter)
 {
     if (!Request.IsAjaxRequest())
     {
         return(View(_tagSrv.Get(filter)));
     }
     else
     {
         return(PartialView("Partials/_List", _tagSrv.Get(filter)));
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Tag搜索
        /// </summary>
        public static int TagSearch(TagSearchFilter filter, string[] fields, string query, XElement root)
        {
            var containfilters = new List <ContainFilterNode>();
            var pindx          = VideoNodeKeyArray.Instance.Items[new VideoNodeKey(filter.platform, 0, filter.auth)].ToString();

            containfilters.Add(new ContainFilterNode()
            {
                FieldName = EpgIndexNode.Flags, Text = filter.dimension
            });
            containfilters.Add(new ContainFilterNode()
            {
                FieldName = EpgIndexNode.PlatformIndex, Text = pindx
            });
            //var fbname = string.Empty;
            //if (filter.forbidden)
            //{
            //    if (ForbiddenAreaCache.Instance.Items.ContainsKey(filter.fbcode))
            //    {
            //        fbname = ForbiddenAreaCache.Instance.Items[filter.fbcode].ForbiddenAreaName;
            //    }
            //    else
            //    {
            //        filter.forbidden = false;
            //    }
            //}
            //if (filter.forbidden)
            //{
            //    containfilters.Add(new ContainFilterNode() { FieldName = string.Format("{0}{1}", EpgIndexNode.ForbiddenCode, pindx), Text = fbname.ToLower() });
            //}
            var node = new SearchNode();

            if (filter.lang == CustomArray.LanguageArray[1])
            {
                node.IsNoPaging = true;
            }
            node.Key            = filter.k;
            node.Pindex         = pindx;
            node.Queries        = query;
            node.Fields         = fields;
            node.Occurs         = EpgIndexNode.NameOccurs;
            node.Start          = filter.s;
            node.Limit          = filter.c;
            node.ContainFilters = containfilters;
            node.IndexValue     = EpgIndexNode.IndexValue;
            return(Searcher.DistinctSearch(TagLuceneNet.Instance.IndexDic, node, root));
        }
Exemplo n.º 4
0
 public string TagSearchSmart(TagSearchFilter filter)
 {
     try
     {
         var xml   = new XElement("taglist");
         var count = LuceneNetUtil.TagSearch(filter, EpgIndexNode.NameField, Searcher.SegmentKeyWord(filter.k), xml);
         xml.AddFirst(new XElement("count", count), new XElement("page_count", PageUtils.PageCount(count, filter.c)));
         return(xml.ToString(SaveOptions.DisableFormatting));
     }
     catch (KeyNotFoundException)
     {
         return(NoPlatForm());
     }
     catch (Exception ex)
     {
         return(BoxUtils.FormatErrorMsg(ex));
     }
 }