Modifying DotNetNuke Search and Improving the Results

Saturday, July 14th, 2007 | Artemis Solutions Group, Custom Development, DotNetNuke, Improving Code, Open Source, SEO, Search Engines, Search Modules, Search Results, Stored Procedure Improvement, Usability, Web Development, Websites, Work Stuff

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

7 Comments to Modifying DotNetNuke Search and Improving the Results

Mark
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!

Joe Sak
September 20, 2007

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.

Chris
November 2, 2007

switch out the si.title t.tabname as Title

Jon Harvey
February 12, 2008

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

Quisenberry
July 29, 2009

Excellent site,Thanks for this great post – I will be sure to check out your blog more often.Just subscriped to your RSS feed….

trouble2
September 23, 2009

You must mean:


AND (sw.Word like ‘%’ + @Word + ‘%’ or m.ModuleTitle like ‘%’ + @Word + ‘%’)
AND (t.IsDeleted = 0)

trouble2
September 23, 2009

Oh yeah, and if you want to search for pagetitle, description, etc. you can look here:
http://www.codeplex.com/DNNSearchEnhanced/Release/ProjectReleases.aspx?ReleaseId=21326

Leave a comment

Search

Social Media

About the Author

I'm a Front-End Web Developer from Chicago, IL. I like XHTML, CSS, JavaScript, last.fm, 37signals, flickr, Getting Real, dogs, bikes, social life, ROWE, speaking my mind, UX/UI engineering & design, dinner dates, dancing, movies, indie rock music, hipsters, scene kids, bars, food co-ops, drums, writing, books, organic food, eco-friendly, progressive thinkers, the secret message of Jesus, and lots of other things.