Once again, the main search results, which is now called Everything, does not include People search results. So it's not really everything. The reason is because there is a special People Search Results web part that is catered towards the User Profiles and their respective properties. If I searched for my last name, my personal profile result does not appear:
It's all good. With the the SharePoint Search capabilities, you can add some people results into my main search (Everything). First go to the site settings of your Search Center and under Site Collection Administration click on Search Query Rules:
Select Local SharePoint Results (System) in the Context drop-down:
Under the Settings section, as shown above, select the "More" link option and enter "peopleresults.aspx?k={subjectTerms}". Select People Item from the Item Display Template. Click OK.
Back on the Add Query Rule page, click Save.
Run your search again (it may take a moment for the changes to appear):
The People Results were modified in the above screen shot to protect real people information.
Now I have people results appearing in the search results under Everything!!!
Once that is selected, click on New Query Rule:
On the Add Query Rule page, add a rule name, remove the condition, and then click on the Add Result Block link:
On the Add Result Block page change the Title to state "People Results". In the Select this Source, select Local People Results (System) and select the amount of items. The default is 2 and that's probably not enough (just like beer or martinis). 3 or 5 seem like good numbers.
Under the Settings section, as shown above, select the "More" link option and enter "peopleresults.aspx?k={subjectTerms}". Select People Item from the Item Display Template. Click OK.
Back on the Add Query Rule page, click Save.
Run your search again (it may take a moment for the changes to appear):
The People Results were modified in the above screen shot to protect real people information.
Now I have people results appearing in the search results under Everything!!!
Great Post. Helped me a lot.
ReplyDeleteGood. You could also just modify the query and remove the portion that excludes people but I needed a promoted result block anyway.
DeleteI dont know what i've done wrong, but mine isn't working :/ Ill give it another go !
ReplyDeleteYou have user profiles in your SharePoint environment, correct?
DeleteI was looking for exactly those settings. Thanks a lot! I could get it to work within minutes!
ReplyDeleteHi Steve,
ReplyDeleteIs there away to edit the preview information?I don't want others to see my Authored documents.. is there away to change it to something else.. like information about me..
Thanks in advance
Yes you would need to create a new Person Display Template along with a new Person hover panel. You can copy the out-of-the-box versions and then modify accordingly. In the hover pabel template, simply remove the divs that show the authored documents. Then you would configure People results to use the new template. That's the best practice method. The easier method is just to edit the current people hover panel template and rip out the authored documents section. I have many posts that describe how to edit the display templates. Here is one that modifies the PDF templates: http://stevemannspath.blogspot.com/2012/10/sharepoint-2013-pdf-preview-in-search.html
DeleteYou would follow similar steps but just modify the person hover template instead.
could you please help me locate divs that show the authored documents? which template am I looking into?
DeleteI am still on holiday but the template is Item_Person_HoverPanel.html. I am sure you'll find the divs towards the bottom.
DeleteI checked the Item_Person_HoverPanel.html, I could not find the DIV you are referring to? Care to elaborate? Thanks
DeleteActually I think it is this:
DeleteAddPostRenderCallback(ctx, function(){
var docCtrlElem = document.getElementById(dynTagId);
Srch.PSU.documentsByQuery(ctx.ClientControl, uname, docCtrlElem, infoAvailable, isExpResult);
});
Hi Steve, the code you mentioned above is already commented out. Any other ideas how to get rid of the Authored documents section?
DeleteThank you.
It may look commented out but that's the way the code looks in the HTML version of the template. I would make a copy and actually remove the code in question. The use the copy of the template.
DeleteHi Steve,
ReplyDeleteI'm a beginner and try to learn Sharepoint Search 2013. I've done the same, but mine isn't working...How can I look up if my user profiles are correct?
Thanks in advance.
You would need to go into the User Profile Service Application and verify the profiles have been synchronized. This is done via Central Admin -> Manage Service Applications.
DeleteAmazing! Thank you for the great response.
DeleteI did the same thing in my solution, but when I wanted to display some additional managed properties it turned out I can't... That is - the property mapping is set perfectly fine, it works and displays under people tab, but the result block simply don't get the additional properties... Any ideas?
ReplyDeleteYou may need to update the Result Type:
Deletehttp://stevemannspath.blogspot.com/2013/03/sharepoint-2013-search-managed-property.html
How you found a way to deploy a result block programatically? I can only find internal classes and methods?
ReplyDeleteI haven't done it programatically. I haven't looked into it either.
DeleteHello Steve
ReplyDeletethanks for the great post. I have a question regarding to query rules. If my user is looking for "cancelation" I don't want to show him any results. If I could show him an error message it would be perfect. Maybe with the "Change the rank by changing the query"?
Yes! I had to do something similiar but change the search term. In your case, clear out the search query term box. I just tested this and no results appear.
DeleteAwesome! It works. But now I have the next problem :):
DeleteCan I do the same, if one of my user is looking for a managed property? For example "autor:F123456" . I don't want that the users are able to search for autor. Do you have an idea?
In your Search Schema, edit the autor managed property and make sure Queryable is not selected. If you don't want them to get results trying "F123456" either, then make sure Searchable is unselected as well. Run a full crawl after these modifications.
DeleteHi Steve,
ReplyDeleteI encountered a little issue with my search result. I tried to follow your post without any good results.
It could be great if you could help a sharepoint newbie like me.
In people search, when I put the first 3 letters of a user name (example DES), I would like to see a list of users where LastName begin with DES letters.
But in fact, the search give me a list of users where it find DES letters in others fields of the profils (like Function, Direction, Services ...)
How can I priorize the result of this query to show me in the top, every LastName users which are beginning with 3 letters I wrote in the search?
Don't know if my question was really clear.
Anyway, thanks for your post (and maybe help)
I understand what you are saying. We have our own source for people data so we don't use the user profiles. What I did was dump out the last names and the full names of all of our employees and clients. From this I created a suggestion file and uploaded that to SharePoint. I am not sure how to resolve your issue directly. There are two sets of suggestions - content and people. Your problem is in the People. Anything I can think of right now would be a hack.
DeleteGreat post!
ReplyDeleteThanks ;)
Hi,
ReplyDeletedoes this only work in an enterprise search center site? i have tried in a normal team site but it doesn't work
thanks
I have implemented search results in other sites. Compare which Site Collection and Site features are activated.
DeleteDid you update the Result Type? http://stevemannspath.blogspot.com/2013/03/sharepoint-2013-search-managed-property.html?m=1
ReplyDeletehi,
ReplyDeletedidnt see the option to update result types, i did a full reboot of my farm just to clear any cobwebs, but this didnt resolve it either,
however, i did then create a copy of the person result type and told it use my new template which displays the telephone number, so now my people search under everyone shows the correct details!
so thanks for the pointer about the result types! i'm a complete newbie to sharepoint but picking things up quickly - next challenge is to get office location in there!
thanks again
Really appreciate it! Just teaches me there are so many aspects of SharePoint OOB that need to be explored. Thanks you!
ReplyDeleteGood stuff! This has saved my team days to weeks of time!
ReplyDeleteJust what I wanted - Thanks!
ReplyDeleteThat worked just great! Exactly what I needed!
ReplyDeleteHi. Excellent post. Worked perfectly for adding people to everything. However, now normal people search returns no results. Should this be an after effect? Normal people search has no results for the person but "everything" does? Thank you
ReplyDeleteShould not be an after effect. Check the Search Results web part configuration - specifically within the Change Query dialog.
DeleteWorked for me! Thanks for the great post!
ReplyDeletedo you know why the sorting of the people results on the 'everything' page is different to the sorting on the people result page?
thank you
Hi, how to return fuzzy search in everything?
ReplyDeleteHaven't officially investigated fuzzy searches, however, I would look at the various ranking models that are available. Also, creating and uploading a thesaurus may help as well.
ReplyDeleteHi, It seems that fuzzy people search works fine the people search but not in everything
ReplyDeleteSharePoint 2013 also provide nickname search. On People's tab I am able to see the results. but on Everything tab the same nickname search do not bring through results. So by applying your suggested query rule will that solve the problem or some other extra work I will have to do?
ReplyDeleteThe results should be the same with the promoted result. I also have name variations in my thesaurus. For example: Rob, Robert, Bob...
DeleteHi Steve, are you saying thesaurus is working on people search (people scope) as well?
DeleteYes. It works for all scopes.
DeleteExactly what i was looking, Thanks.
ReplyDeleteThis is good solution. It worked for me. The only problem I have is that it shows the result block for people even if I did not search for a person. For example, it shows the top one person for finance before showing the result set for finance. How can prevent it from showing the result block for people when the search term is not a person?
ReplyDeleteIt is not an AI system. If I search for "Washington" am I looking for D.C. content or last name??
DeleteIt is not an AI system. If I search for "Washington" am I looking for D.C. content or last name??
DeleteI have done this with success. The one part I am trying to do differently is use a custom Display template that shows more user data. I have this setup and working properly on people search. When using the same display template in the block settings, only a few of the attributes show up versus all like on people search. Any idea?
ReplyDeleteCheck the Result Source and make sure it is going against People. You can also use the browser developer tools to inspect the ctx.CurrentItem to see what is coming back.
DeleteI have double checked and the block result source is going against "Local People REsults (System)". I am not sure how to inspect the ctx.CurrentItem with the dev tools, can you provide a little insight on that?
ReplyDeleteCan I show the active directory ID results in people set?currently it is showing under everything.
ReplyDeleteNeed more clarification of what you mean.
DeleteNeed more clarification of what you mean.
DeleteThanks for this article, but I found the promoted people result in "everything scope" is different from the "people scope" search result.
ReplyDelete1. if you search "Bill" on "everything", "William" won't come up, but it will come up on "people scope" search result page.
2. if you search "William", "Williams" won't come out on "everything", but it will come up on "people scope" search result page.
3. the result sort order is different.
Do you have any ideas about how to make them consistent?
Genius!
ReplyDeleteSteve,
ReplyDeleteThanks its worked for me.
Steve, Great Article, One question maybe you can help me, I copied "Local People Results" Result Source to customize it to hide certain domain users and when I use it results come back but it seems the display template is blank like this: https://social.technet.microsoft.com/Forums/getfile/867139 what can be wrong? MANY THANKS FOR YOUR TIME.
ReplyDeleteGo into the result types and see if they need to be updated. There will be a bar at the top of the page alerting you to this.
DeleteGo into the result types and see if they need to be updated. There will be a bar at the top of the page alerting you to this.
DeleteThanks!
ReplyDeleteAwesome post. worked like charm. Much thanks dude.
ReplyDeleteHi Steve,
ReplyDeleteGreat post!
I have to change 'People' label to People Directory' in the search result page
Can you please help me to do the changes.
Site Settings -> Search Settings
DeleteHi Steve,
ReplyDeleteCan I customize document library search "Find a file", so that when performing search, the results are displayed based only on file name and not the content. I am aware of using Filename:Keyword but that doesnot work all the time.
try FileLeafRef:keyword
Deletetry FileLeafRef:keyword
DeleteFantastic post! Weird fact, it didn't show up in a Bing search! Thank you for this!!
ReplyDeleteI have a duplicated user in my search, how can I remove it?
ReplyDeleteIf you have People as a separate Content Source, then I would delete the Content Source, wait until there are no results left in search, and then run a full crawl. Otherwise, I would reset all crawled content and then do a full crawl.
DeleteHi Steve, very useful post (and many others too), I really appreciated it as I was trying to get my head around SP2013 search just now. A related question, if you have a moment: It seems that to take advantage of the built-in people-search specific functions like phonetic name matching "people search results" are required and this seems to imply that there needs to be a user profile. Is this correct? Our requirement is to search across user profiles + 100K or so external contacts that ideally won't have user profiles (the external contacts are in a SQL server table accessed via BDC, just coming up as web page results for now). Many thanks again!
ReplyDeleteI'm thinking that if you map the BDC crawled properties to the People managed properties you will be fine.
DeleteHi Steve, i have customers documents in my main library. How can i enable 'People Name'/ fuzzy search on these documents?
ReplyDeleteadd a column to the library to store the customer name
DeleteThank you so much. This helped me to create the result block as is in 5 mins.
ReplyDelete