62,074
社区成员
发帖
与我相关
我的任务
分享
//上面查询代码就不贴了
listResult.Add(result);
}
return listResult;
}
finally
{
searcher.Close();
reader.Close();
directory.Close();
}
string[] hotFocus = new string[12];
if (HttpRuntime.Cache["hotFocus"] == null)
{
//select top 5 * from baiduHotFocus order by newid()
string sqlStr = "select top 12 HotFocus from baiduHotFocus where status=1 and HotFocus in(select top 30 HotFocus from baiduHotFocus order by Updatetime desc) order by newid()";
DataTable dt = SqlHelper.ExecuteDataTable(sqlStr);
for (int i = 0; i < 12; i++)
{
hotFocus[i] = dt.Rows[i][0].ToString().Trim();
}
if (hotFocus != null)
{
HttpRuntime.Cache.Insert("hotFocus", hotFocus, null, DateTime.Now.AddMinutes(1), TimeSpan.Zero);
}
}
else
{
hotFocus =(string[]) HttpRuntime.Cache["hotFocus"];
}
and HotFocus in(select top 30 HotFocus from baiduHotFocus order by Updatetime desc) //还用In? 另外你的索引呢 我怎么没看到