Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityCommunity Membe...Community Membe...Search ImprovementsSearch Improvements
Previous
 
Next
New Post
7/13/2007 4:01 PM
 

This is a replacement for the DNN GetSearchResults Stored Procedure that we've found useful in improving search results for our clients:

 



CREATE procedure dbo.GetSearchResults

    @PortalID int,

    @Word nVarChar(100)

AS

SELECT si.SearchItemID,

    sw.Word,

    siw.Occurrences,

    siw.Occurrences + 1000 as Relevance,

    m.ModuleID,

    tm.TabID,

    si.Title,

    si.Description,

    si.Author,

    si.PubDate,

    si.SearchKey,

    si.Guid,

    si.ImageFileId,

    u.FirstName + ' ' + u.LastName As AuthorName,

    m.PortalId

FROM    SearchWord sw

    INNER JOIN SearchItemWord siw ON sw.SearchWordsID = siw.SearchWordsID

    INNER JOIN SearchItem si ON siw.SearchItemID = si.SearchItemID

    INNER JOIN Modules m ON si.ModuleId = m.ModuleID

    LEFT OUTER JOIN TabModules tm ON si.ModuleId = tm.ModuleID

    INNER JOIN Tabs t ON tm.TabID = t.TabID

    LEFT OUTER JOIN Users u ON si.Author = u.UserID

WHERE   (((m.StartDate Is Null) OR (GetDate() > m.StartDate)) AND ((m.EndDate Is Null) OR (GetDate() < m.EndDate)))

    AND (((t.StartDate Is Null) OR (GetDate() > t.StartDate)) AND ((t.EndDate Is Null) OR (GetDate() < t.EndDate)))

--AND (sw.Word = @Word)

 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 + '%')

ORDER BY Relevance DESC

GO

 

 

------------------- Now, does anyone know what file I can edit to make this SP part of the DNN install?

 
New Post
7/13/2007 4:18 PM
 

My guess is that you could just add in a new SqlDataProvider file and have this as an alter procedure statement.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
7/13/2007 4:43 PM
 

Can you tell me how to do that?

 
New Post
7/13/2007 6:57 PM
 

Joe Sak wrote

Can you tell me how to do that?

The easy way:

change it from "Create Procedure" to "Alter Procedure" ...

then just run it as a script in the Host | SQL box

Note that this will affect the entire DNN install, not just a given portal.


pmgerholdt
 
New Post
7/13/2007 9:08 PM
 

Actually I found the install script in the providers/dataproviders/sqldataproviders file so it's automatic every install we perform.

 

thanks : )

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityCommunity Membe...Community Membe...Search ImprovementsSearch Improvements


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out