Recently, I modified the Stored Procedure named “GetSearchResults” to improve the results pages in DotNetNuke web sites. Here is my explanation from the DNN forums.
OK — here is where the actual change is:
——————–
AND (sw.Word like ‘%’ + @Word + ‘%’)
AND (t.IsDeleted = 0)
AND (t.DisableLink = 0)
AND (m.IsDeleted = 0)
AND (t.PortalID = @PortalID)
OR (m.ModuleTitle like ‘%’ + @Word + ‘%’)
———–
The bolded lines are the changes
First line is how the search term is matched. Instead of exact, it does a like. We found that a lot of clients would complain that searching “map”, for instance, would not return pages which had the word “maps” on them. Or “auto” won’t give you “automobile”.
Second is the disablelink line. We had the problem of hidden pages showing up in results but realized sometimes we WANT hidden pages to show up, but sometimes we hide pages because they’re not ready to be published. So I decided that if I “disable” the page then I definitely don’t want it to come up in the results, but I might want to keep it for later (we aren’t much for deleting pages around here)
Third is the OR m.ModuleTitle like ‘%’ + @Word + ‘%’ part — now this is kind of a subjective one. I have a web site right now for a client that sells insurance. Home insurance, life insurance, and car insurance. When I searched “car” I didn’t get the car insurance page at all, even though the page was titled car insurance and the module was titled car insurance… The content copy used the word “automobile” because this particular client is very traditional and was picky about that wording. So I added the “OR” line because if we put the search term in the title, it’s most likely relevant. We know module titles are what show up as the links on the SRP and so we make sure those titles are always relevant and helpful for the user.
BUT — we would like to see page name or page title as an option in the settings for how the text displays. we couldn’t figure out how to modify the core to do that.
OK that is all i hope this has been informational
No, I don’t have a solution on displaying the page title, though I imagine you could switch out m.ModuleTitle with t.PageTitle?
But a good solution and replacement for DNN search is Xepient’s OpenSearch software.
Artemis used it for City of Southfield.
switch out the si.title t.tabname as Title
To get the page title instead of the module title I wrote this function…
Public Function FormatTitle(ByVal TabID As Integer) As String
Dim strURL As String
Dim objTabs As New DotNetNuke.Entities.Tabs.TabController
Dim objTab As DotNetNuke.Entities.Tabs.TabInfo
objTab = objTabs.GetTab(TabID)
strURL = objTab.Title.ToString()
If strURL = “” Then
strURL = “Home”
End If
Return strURL
End Function
Hope that helps!
Cheers
Jon
http://www.coderequired.com
September 20, 2007
Hi Joe,
Any luck on figuring out how to get the Page Title displayed, instead of the Module Title? If no, do you have any recommendations on Search Engines to replace the core with?
Please let me know. Thanks!