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

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"

share|improve this question
    
is the property crawled? –  Salvatore Di Fazio Feb 6 '13 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 '13 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/… –  Salvatore Di Fazio Feb 7 '13 at 8:31

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
This was what i was looking for and it helped me with filtering on the scope as well. Thanks! –  Jacob A Feb 18 '13 at 15:52

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.