By: TwitterButtons.com

Recent blog posts

User login

Home | Blogs | Stephane Eyskens's blog

Unexpected People Search results - the right way to fix it!

Hi,

When performing search queries scoped to the People scope, you can sometimes end-up with no results although you know there are user profiles containing the keyword you typed.

This can be due to the following reasons:

1) You search on custom Profile Properties

When creating a custom profile property, if you want to be able to perform a search query on that property without being forced to create a corresponding Managed Property, you can just edit the ContentsHidden built-in managed property and add a mapping to your own custom profile property:

Afterwards, run a full crawl and you will be able to search on that property. Note that if you only create a Managed Property, then you will be able to perform explicit search filters such as MyProp:"MyValue" but looking only for "MyValue" will still not work as long as you didn't include the crawled property in the ContentsHidden managed property.

This behavior is still true after June 2011 CU.

2) With built-in managed properties pointing to people crawled properties

You might never have noticed so far but if you perform an explicit search on the built-in WorkPhone and MobilePhone managed properties, the search results are always empty. So, specifying WorkPhone:"..." returns nothing while just searching for the phone number returns results.

Instead of creating a new managed property pointing to the workphone crawled property as I've seen in many blogs, the best option to me is just to modify the behavior of the built-in managed property and make it usable in the search centers.

In order to be able to apply specific search filters on such properties from within a search center, you need to make them fulltextqueriable. You can easily achieve that via PowerShell. Taking the example of workphone, the following PowserShell commands will make WorkPhone searchable in a default Enterprise Search Center:

$app=Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$mp=Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $app -Identity WorkPhone
$mp.FullTextQueriable=$true
$mp.Update()

Run a full crawl and everything should be all right :

By default, when you add a custom managed property, it is automatically set to FullTextQueriable=True, that's why this is not so obvious to think that some built-in properties are not following those defaults.

Note : this fix does not apply for Office 365...

Happy Coding!