请教大神,我现在搜索可以搜索到内容,但是搜索显示结果只有标题,没有相关内容,请问怎么改可以在搜索结果中像百度搜索那样,在搜索结果标题下面也显示出内容
- @{
- PageInfo pageInfo = new PageInfo()
- {
- PageSize = 1000,//每页显示10条数据
- CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
- };
- string kw = StringHelper.Format<string>(HttpContext.Current.Request.QueryString["kw"]);
- }
- <div class="margin-top-10 com-bd">
- @Html.Partial("BreadcrumbPartial")
- <div class="info-content pages-list" style="min-height:500px;">
- <ul class="m-newslist clearfix">
- @{
- foreach (var item in Html.InfoDataList(new{Table = "article"}, "[content] like @kw", new { kw = "%"+kw+"%" }, pageInfo))
- {
- string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
- string date = item.Thedate.ToString("yyyy-MM-dd");
- <li class="clearfix">
- <span class="fl title">
- <a href="@url" target="_blank" title="@item.Title">@Html.Raw(item.Title.Replace(kw,"<strong>"+kw+"</strong>"))</a>
- </span>
- <span class="fr date">
- @date
- </span>
- </li>
- }
- }
- </ul>
- @Html.Partial("PagebreakPartial", pageInfo)
- </div>
- </div>
复制代码