Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a Site Definition in Visual Studio 2012 based on Community web template. The problem is that when I deploy the site definition and create a new community choosing my new template the search results of this community are different from the OOB web template Community site.

Let me explain; following the instructions in DotNetMafia Corey Roth Post I noticed that resultRow object has 49 Keys in the Dictionary using this code keywordQuery.QueryText = "WebTemplate=COMMUNITY -ContentClass=urn:content-class:SPSPeople"; 4 of these keys are ResultTypeId = 28, CommunityMembersCount = 1, CommunityRepliesCount = 0, CommunityTopicsCount = 0.

It turns out that the result on my created community using my custom site definition using this query keywordQuery.QueryText = "WebTemplate=ComSiteDefinition -ContentClass=urn:content-class:SPSPeople" returns 44 Keys in the resultRow Dictionary ResultTypeId=11 instead of 28 and no CommunityMembersCount, RepliesCount and TopicsCount properties. In the refiners appears "Sharepoint site" instead of Community.

Anyone has an idea how to solve this? Thank you very much.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

After digging yesterday in Sharepoint inside out I came up with the solution!!

Go to Site Settings --> Result Types and:

  • Click Add new Result Type
  • Give a name
  • Conditions dropdown select All Sources
  • In What types of content should match? Leave the default option "Select a value"
  • Click Show More Conditions
  • In Which custom properties should match? select WebTemplate --> Equals any of --> MYSITEDEFINITION
  • In actions section What should these results look like? Select Community item from dropdown
  • Click on Save

And everything will be working perfectly!!

share|improve this answer
    
I had the same problem and I solved it with this solution. Thank you –  user14459 Jan 28 '13 at 10:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.