1

So i'm trying to figure out how to filter search results to show those users who have certian fields of their user profile as a specific value.

For example...i have an employeestatus field and it is either active or inactive, I have the field setup in the User Profile Properties to be "indexed" however when i append a query filter to the people search web part in my search center it returns no values...can someone tell me if my formating is incorrect or point me towards how to properly call those fields and structure a query for them?

"AND employeestatus=ACTIVE"

3
  • is the property crawled? Feb 6, 2013 at 15:12
  • I assumed that because it is listed as index it should be....so i looked at my search application and under Metadata Properties i was able to search for it and found it...however it did not have a mapping assigned to it...it was "included in index" Should i have a mapping for it?
    – Jacob A
    Feb 6, 2013 at 18:59
  • 1
    You should map it or in the Results.xml file you can get information about it. Take a look here: salvatoredifaziosharepoint.blogspot.co.uk/2012/10/… Feb 7, 2013 at 8:31

1 Answer 1

1

When you create a new profile property and check "Indexed" SharePoint will automatically create appropriate crawled property (after incremental or full crawl of user profiles) in format People:[Your property internal name].

From the UI you can only search for managed properties, so you should add a mapping between your crawled property and a managed property (or create it) through UI or PowerShell. From PoweShell it will following command:

$cp = Get-FASTSearchMetadataCrawledProperty -Name People:[Your property internal name]
$mp = New-FASTSearchMetadataManagedProperty -Name employeestatus -Type 1
New-FASTSearchMetadataCrawledPropertyMapping -ManagedProperty $mp -CrawledProperty $cp

And this is not the end. You should also modify CoreResultWebPart in search centre. This web part knows nothing about your new managed property, you should add it in config. Edit CoreResultWebPart in the search centre, find Display Properties->Fetched Properties and add <Column Name="employeestatus"/>.

Perform a crawl again (you might see an error that property doesn't exist), after this you can search using you property - employeestatus:"Hired". You can also modify xslt source of CoreResultWebPart to show value of this property on search UI.

Links:

Get-FASTSearchMetadataCrawledProperty
New-FASTSearchMetadataManagedProperty
New-FASTSearchMetadataCrawledPropertyMapping

Useful reading (you can skip metadata part) here

1
  • This was what i was looking for and it helped me with filtering on the scope as well. Thanks!
    – Jacob A
    Feb 18, 2013 at 15:52

Your Answer

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

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