0

Just tried to find hashtags used in community discussions and replies. The hashtags are in the Hashtags termset just fine, but the SharePoint search just doesn't find any hashtag I'm looking for.

I found the following blog post which describes exactly this issue as a bug: http://www.chrisweldon.net/systems%20administration/software%20development/sharepoint-2013-community-tagging-architecture-and-bug/

There was supposed to be an update in the June 2013 CU, but I looked through the release notes and couldn't find anything about hashtags. I am on the June 2015 CU and have exactly this issue: SharePoint search does not find hashtags that are used within communities.

Anybody know a way around this problem? Anything I have to do?

I checked two different SharePoint 2013 environments - discussions and replies do not have the hashtag field, so I wouldn't know how SharePoint search would be able to crawl hashtags from discussions if there isn't a column?

2
  • 1
    I posted a similar question some time ago (no answer yet) but I think the implementation of hashtags within SharePoint communities is somewhat flawed/broken? But I hope I am wrong... sharepoint.stackexchange.com/questions/205779/…
    – AM2FTW
    Commented Mar 9, 2017 at 13:45
  • You did ask a very similar question, and yes it seems to be broken with an easy fix. See the answer below to fix the problem. Don't have time right now to file a bug report.
    – Dennis G
    Commented Mar 11, 2017 at 14:22

1 Answer 1

1

As it often is with SharePoint, your best answer you will find yourself by looking into the inner working of things.

The problem is that the HashTags column is set to Hidden in a Community discussion board. Hidden columns are not indexed by SharePoint search so you cannot find them. Easy solution: Set the column to visible, only that this is a bit more complex as CanToggleHidden is set to false...We will need some ugly reflection for that. The following powershell will set the column to visible and allow search to crawl.

$web = Get-SPWeb http://myweb
$list = $web.GetListsOfType([Microsoft.SharePoint.SPBaseType]::GenericList) | ? {$_.BaseTemplate -eq "DiscussionBoard"}
$fld = $list.Fields["HashTags"]
$hiddenState = $fld.Hidden
Write-Host "Currently 'HashTags' Hidden is set to $hiddenState"
if ($hiddenState) {
  $type = $fld.GetType()
  $method = $type.GetMethod("SetFieldBoolValue",[System.Reflection.BindingFlags]$([System.Reflection.BindingFlags]::NonPublic -bor [System.Reflection.BindingFlags]::Instance))
  $method.Invoke($fld, @("CanToggleHidden",$true))
  $fld.Hidden=$false
  $fld.Update()
  Write-Host "Now field 'HashTags' is set to visible"
}

You will need a full crawl after setting the HashTags field to visible.

Bear in mind that the HashTag profile page on the MySite as well as the Trending hashtags WebPart also on the MySite will still only show Newsfeed Hashtags. The underlying search for both pages is hardcoded to only look for newsfeed content types - as discussion lists have a discussion and a message content type this way you won't find any HashTags for these items.

On a technical note: The search query being used (Microsoft.SharePoint.Portal.WebControl.HashTagProfile.InitTaggedItem) on the HashTagProfile page is "NOT(MicroBlogType:2 OR MicroBlogType:4 OR ContentTypeId:0x012002* OR ContentTypeId:0x0107* OR WebTemplate=COMMUNITY)owstaxIdMetadataAllTagsInfo:#0" - so the code is explicitly excluding community content. Even though all HashTag links in communities point to the FeedRedirector and in turn to the HasTagProfile page.. won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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