Search in DNN Is implemented in the following manner.
- there is a scheduled task to 're-index' all module content. Check your scheduler to see when and how often it runs. You can also kick off a manual re-index on the Search admin page
- since the search re-indexer cannot know anything about a module's content, it does so by asking each module on your site to provide a collection of 'SearchItems' whcih is then adds to it's own collection to index
- so, each module is responsible for implementing the iSearchable interface and a function named GetSearchItems() which will be called by the dnn re-indexing service
- here is what the GetSearchItems() function looks like for the Repository module...
Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) As Services.Search.SearchItemInfoCollection
Implements Entities.Modules.ISearchable.GetSearchItems
oRepositoryBusinessController = New RepositoryBL
Dim SearchItemCollection As New SearchItemInfoCollection
Dim RepositoryObjects As ArrayList = GetRepositoryObjects(ModInfo.ModuleID, "", "Name", oRepositoryBusinessController.IS_APPROVED, -1, "", -1)
Dim SearchItem As SearchItemInfo
Dim UserId As Integer = Null.NullInteger
Dim objItem As RepositoryInfo
Dim strContent As String
Dim strDescription As String
For Each objItem In RepositoryObjects
If IsNumeric(objItem.CreatedByUser) Then
UserId = Integer.Parse(objItem.CreatedByUser)
End If
strContent = System.Web.HttpUtility.HtmlDecode(objItem.Name & " " & objItem.Description)
strDescription = HtmlUtils.Shorten(HtmlUtils.Clean(System.Web.HttpUtility.HtmlDecode(objItem.Description), False), 100, "...")
SearchItem = New SearchItemInfo(ModInfo.ModuleTitle & " - " & objItem.Name, strDescription, UserId, objItem.CreatedDate, ModInfo.ModuleID, objItem.ItemId.ToString, strContent, "id=" & objItem.ItemId.ToString)
SearchItemCollection.Add(SearchItem)
Next
Return SearchItemCollection
End Function
|
So, the function retrieves all of the repository data for the module then iterates through the repository data items. For each record it creates a SearchItemInfo record, then adds it to a SearchItemCollection which is returned at the end.
The main point here is that the SearchItemInfo.content propery is what is indexed, and in the case of the repository module, what is indexed is the Name field and the Description field.
strContent = System.Web.HttpUtility.HtmlDecode(objItem.Name & " " & objItem.Description)
|
I hope that helps you understand how the core DNN search works.