如果在我的剃刀模板中获得此代码:
@using DotNetNuke.Entities.Modules
@using ToSic.Eav.DataSources
@using ToSic.SexyContent.Search
@functions
{
// Customize data not used - but it could often be used in search-demos, so I left it in
public override void CustomizeData()
{
// Don't customize anything, nothing to customize in this case
}
/// <summary>
/// Populate the search - ensure that each entity has an own url/page
/// </summary>
/// <param name="searchInfos"></param>
/// <param name="moduleInfo"></param>
/// <param name="startDate"></param>
public override void CustomizeSearch(Dictionary<string, List<ISearchInfo>> searchInfos, ModuleInfo moduleInfo, DateTime startDate)
{
// all we'll do is tell the search engine that the URL is a bit different for each found entity
foreach (var si in searchInfos["SearchIndex"])
{
si.QueryString = "?id=" + si.Entity.EntityId;
}
}
}
使用此数据查询:
但是dnn搜索没有拿起物品?搜索索引器运行时,我没有在dnn日志中看到错误。我是否必须使用自定义数据功能?
我运行的查询就是这个:
SELECT [Hotel_ID] as EntityId
,[Hotel_ID]
,[Hotel_Name] + ' in ' + [City_Name] as EntityTitle
,[Hotel_Name]
,[Hotel_Address1]
,[Hotel_Address2]
,[Hotel_Address3]
,[Hotel_LAT]
,[Hotel_LNG]
,[Hotel_Website]
,[Hotel_Telephone1]
,[Hotel_Telephone2]
,[Hotel_Email1]
,[Hotel_Email2]
,[Hotel_Fax1]
,[Hotel_Logo]
,[Hotel_ZoomLevel]
,[City_Name]
,[Neighborhood_Name]
,[Departments_Name]
FROM [CI-HotelList]
有人能指出我正确的方向吗?