public List<CategoryEntityComplete> searchComplete(string searchitem)
 {
     List<CategoryEntityComplete> l = new List<CategoryEntityComplete>();
     var list = (from a in db.ESHOP_NEWs
                 join b in db.ESHOP_NEWS_CATs on a.NEWS_ID equals b.NEWS_ID
                 where (db.fClearUnicode(a.NEWS_TITLE).Contains(ClearUnicode(searchitem)))
                 &&a.NEWS_TYPE==1
                 select new
                 {
                     a.NEWS_TITLE,
                     a.NEWS_PUBLISHDATE,
                     b.ESHOP_CATEGORy.CAT_NAME
                 }).Distinct().OrderByDescending(n => n.NEWS_PUBLISHDATE).OrderByDescending(n=>n.CAT_NAME).Take(10);
     foreach (var i in list)
     {
         CategoryEntityComplete enti = new CategoryEntityComplete();
         enti.catname = i.CAT_NAME;
         enti.title = i.NEWS_TITLE;
         l.Add(enti);
     }
     return l;
 }
        public List<CategoryEntityComplete> searchComplete(string searchitem)
        {
            string[] arr = searchitem.Split(' ');
            List<CategoryEntityComplete> l = new List<CategoryEntityComplete>();
            for (int s = 0; s < arr.Length; s++)
            {
                if (s == 0)
                {
                    var list = (from a in db.ESHOP_NEWs
                                join b in db.ESHOP_NEWS_CATs on a.NEWS_ID equals b.NEWS_ID
                                where (SqlMethods.Like(a.NEWS_KEYWORD_ASCII, ClearUnicode("%" + arr[s] + "%")))
                                && a.NEWS_TYPE == 1
                                select new
                                {
                                    a.NEWS_TITLE,
                                    a.NEWS_PUBLISHDATE,
                                    b.ESHOP_CATEGORy.CAT_NAME
                                }).Distinct().OrderByDescending(n => n.NEWS_PUBLISHDATE).OrderByDescending(n => n.CAT_NAME);

                    foreach (var i in list)
                    {
                        CategoryEntityComplete enti = new CategoryEntityComplete();
                        enti.catname = i.CAT_NAME;
                        enti.title = i.NEWS_TITLE;
                        l.Add(enti);
                    }
                }
                else
                {
                    var list = l.Where(n=>n.title.ToLower().Contains(arr[s].ToLower())).ToList();
                    if (list != null && list.Count > 0)
                        l = list;
                }
                
            }
            return l;
        }