I've tried 3 different ways of creating the GetSearchItems function:
- from the Survey iSearchable tutorial referenced in these forums
- modify the canned script that is created when generating a new dnn module
- modifying the Text/HTML function
Everything looks okay with all three of the functions.
During testing:
- The module definition has "Searchable" checked.
- The function (no matter which version I use) clears syntax and semantic checks. (no squiggly lines)
- I've checked and double-checked my namespace (changed to SC from YourCompany)
- I've made the manual update to the DesktopModules table where SupportedFeatures is set to 3.
- I've confirmed the businesslayercontroller name (when I don't have the right name, the "Searchable" definition parameter is unchecked)
- I've updated the definition on each new test
- I've updated and re-indexed the search as Host on each new test
- I've cleared the test module and all associated data and added it back in at appropriate times
- No errors are logged
- The SearchItems table does not include a row for my module (when there is a module added to a page with data)
- The only parameter that I've been unsure about is the PubDate and I've used a wide variety of data to pass (see below for some examples)
Nothing. No results. Code below
Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) As DotNetNuke.Services.Search.SearchItemInfoCollection Implements Entities.Modules.ISearchable.GetSearchItems
'''''''''''''''------------ Function version 1 - based on canned code when generating new dnn module
'Dim SearchItemCollection As New SearchItemInfoCollection
'Dim ProductDetails As ProductDetailsInfo = SC.Modules.ProductDetails.DataProvider.Instance.SC_ProductDetails_GetAll(ModInfo.ModuleID)
'Dim SearchItem As SearchItemInfo = New SearchItemInfo(ModInfo.ModuleTitle, ProductDetails.Title & " - " & ProductDetails.Description, 1, Date.Parse(Now), ModInfo.ModuleID, "", ProductDetails.Title & " - " & ProductDetails.Description, "", Null.NullInteger)
'SearchItemCollection.Add(SearchItem)
'Return SearchItemCollection
'''''''''''''''------------ Function version 2 - based on Text/HTML module (with obvious modifications)
'Dim SearchItemCollection As New DotNetNuke.Services.Search.SearchItemInfoCollection
'Dim colProductDetails As List(Of ProductDetailsInfo) = ProductDetails_GetAll(ModInfo.ModuleID)
'Dim objProductDetails As ProductDetailsInfo
'For Each objProductDetails In colProductDetails
' Dim SearchItem As SearchItemInfo = New SearchItemInfo(ModInfo.ModuleTitle, objProductDetails.Title & " - " & objProductDetails.Description, 1, Date.Parse("9/28/2007 8:58:56 AM"), ModInfo.ModuleID, objProductDetails.ID.ToString, objProductDetails.Description, "ItemId=" & objProductDetails.ID.ToString)
' SearchItemCollection.Add(SearchItem)
'Next
'Return SearchItemCollection
'''''''''''''''------------ Function version 3 - based on iSearchable tutorial
' Get the Surveys for this Module instance
Dim colProductDetails As List(Of ProductDetailsInfo) = ProductDetails_GetAll(ModInfo.ModuleID)
Dim SearchItemCollection As New SearchItemInfoCollection
Dim ProductDetailsInfo As ProductDetailsInfo
For Each ProductDetailsInfo In colProductDetails
Dim SearchItem As SearchItemInfo
SearchItem = New SearchItemInfo _
(ModInfo.ModuleTitle, _
ProductDetailsInfo.Title, _
1, _
Date.Now(), _
ModInfo.ModuleID, _
ProductDetailsInfo.ID, _
ProductDetailsInfo.Title & " - " & ProductDetailsInfo.Description)
SearchItemCollection.Add(SearchItem)
Next
Return SearchItemCollection
End Function