Question

I am working on a solution to allow users to search for other users, since we use SharePoint 2010 and have access to the SharePoint people search it seems like an easy solution. For the most part it is close to what is needed but it appears to be missing a few things.

The biggest thing is the ability to search by office/location.

The search appears to return the office location but I can't seem to search on it.

I expected to be able to search on it by doing BaseOfficeLocation:"Office Location To Search For" since Department:"Department To Search for" appears to work.

I have tried Office and OfficeLocation but it just doesn't seem to work. I found a blog that said that it appeared as if this didn't work as expected but there were no more details.

Is there a setting that I need to enable or do I need to do some custom development here?

Was it helpful?

Solution

This might be a little late but here goes.

You basically need to add a metadata property that maps to the office (or whatever) field on the users profile. You then need to have that crawled. Finally you can add office to the search option. Below give you a quick overview of how to do it.

Adding a new managed metadata property

  • Go to Central Admin.
  • Go to manage service applications
  • Go into your search service application
  • On the left under "Queries and Results" go to "Managed Metadata Properties"
  • Click "New Managed Property"
  • Give it a name, I called mine "Office"
  • Click "add mapping" and select people
  • Select "People:Office(Text)" (this depends on which field on the profile you are using to put the office in)
  • Select "Include values from a single crawled property based on the order specified"
  • Click OK

Now run A FULL CRAWL. That's quite important. If it's not a full crawl it wont be picked up.

Wait for the full crawl to finish.

Adding the field to the search

  • You should now be able to search for Office:"office name"
  • That's not very useful to a user
  • What we want is to add it to the search options
  • Edit the page and go to the web part properties for the search box
  • Go to "Miscellaneous" and expand it
  • Open up "Properties" and copy out the XML. Here you now need to add in your new field.
  • It's going to look something like this:
  • <Property Name="Office" ManagedName="Office" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:Office"/>
  • Add that in and then save it back into the web part
  • Click on search option, type in the office in the new office field and click search
  • BOOM!! Office searching.

Unless I'm missing something you're going to need to do this on both the initial people search page and the results page.

Here's a link that i based that all on.

http://blogs.technet.com/b/meamcs/archive/2010/12/23/sharepoint-2010-people-search-using-metadata.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top