Hello,
I'm creating a module in C#. I've implemented the ISearchable interface. This is my code:
public class LMVGVideoController : ISearchable
{
………
public SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo)
{ SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection();
List<LMVGVideoInfo> colVideoInfo = GetVideoList(ModInfo.ModuleID);
string strDescription;
string strContent;
string strTitle;
foreach (LMVGVideoInfo objVideoInfo in colVideoInfo)
{
strTitle = ModInfo.ModuleTitle + " - " + objVideoInfo.Title;
strDescription = HtmlUtils.Shorten(HtmlUtils.Clean(System.Web.HttpUtility.HtmlDecode(objVideoInfo.Description), false), 100, "...");
strContent = objVideoInfo.Title + " " +objVideoInfo.Description;
SearchItemInfo SearchItem = new SearchItemInfo(strTitle, strDescription, objVideoInfo.CreatedByUser, objVideoInfo.CreatedDate, objVideoInfo.ModuleId, objVideoInfo.ItemId.ToString(), strContent, "ItemId=" + objVideoInfo.ItemId.ToString());
SearchItemCollection.Add(SearchItem);
}
return SearchItemCollection;
}
}
In Host -> Module Definitions I've done an update and the checkbox "Searchable" is checked.
But when I try to search an item I obtain some strange results. For example, if I search "Conferenza" the item which title is "Conferenza cna" is correctly found, but if I search "cna" the same item isn't found. I've got another item, which title is "Mork e mindi", and this item is found both writing "Mork" and writing "Mindi". So, I'm really confused
I've tried to debug my application, and it seems search items are correct and are correctly add to SearchItemCollections.
Anyone can help me please?
I've another question: When the GetSearchItems method is called and by whom???