SharePoint Search Five Query Rules

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is Matt McDermott from abdill on I'm going to be talking to you about five query rules that I think every sharepoint geek should know really these are classes of query rules that represent tools for improving find ability in your environment whether it's SharePoint on-premises or SharePoint in office 365 for each of our samples we're gonna come up with kind of our problem statements like I want to promote some content when a user tries to search for it or I want folks to see this when they search for that particular word or phrase or users just aren't searching the right way and we need to help them out in this case our first example is going to be better best bets or what are known in SharePoint 2013 2016 as promoted results for this first query rule we want to demonstrate promoted content and for that purpose I'm going to use the scenario where our training department has developed a course for SharePoint and we want to promote that to our users so we've created a little snippet here with our help of our art department that says that we've got SharePoint classes on February 29th in Austin and so if they click on that it's going to take them to the training site where they can then sign up for the class so I'm going to grab the URL to this and we'll go back to our search site we'll go into site settings and down into query rules and then we have to choose a result source upon which this rule will act in our case we want it on that everything page so we're gonna choose local SharePoint results and we choose new query rule and I called the SharePoint training and I'm gonna choose an advanced query text match the query contains one or more of these phrases so we'll put in here SharePoint and semicolon delimited so I'll put a semicolon there and then we'll put SPS WSS and oh maybe they really need training so we'll put in moss now I don't really care where that where that phrase shows up but I do care about this ad promoted result so this is going to be SharePoint training and the URL is gonna be the URL to that banner now if all we did here was put in a description then they would see the phrase SharePoint training with it link to that URL and the description but instead I want to do render the URL as a banner instead of as a hyperlink and choose save also since we're holding the class on the twenty-ninth I'm going to set this for 228 of 2017 so that after the 28th this rule will no longer be in effect and it won't advertise the fact that the class has already taken place so I go back to this site now and we do a search for SharePoint and we get our banner so these will always show at the top promoted results always show at the top but it still preserves that link to the training site so I'm happy with that and that is our first query rule which is a promoted result to advertise additional content that's available to your end users if you search on a specific phrase so in our better best bet example we used a promoted result and we have a URL that went directly to the content and then we showed that content as a banner because the content was prepped to be shown inside the display template for the best bet and we also set a publishing date so that that content would also expire in the next example we're gonna try to find out when a user searches for something specific and we want to focus that search on specific properties in other words they're using keywords that we want to associate with specific kinds of content you'll also hear people say that they're wasting time using metadata and they still can't find anything or you may say that your users aren't searching the right way but either case what we're going to do now is do a targeted property query based on the end users search in this scenario we're going to be searching for people that know something about SharePoint I'm going to enter the query of SharePoint and then go to the people tab and I'll notice here that I have some people that have skills SharePoint as well as SharePoint in their job title but then I also have people that have SharePoint their job title but nothing in their skills or they're asking me about now ask me about is an opt-in field that the end user fills in and so what I want to do is target those people that have indicated ask me about SharePoint and we'll get them in a query rule and we'll present that at right at the top so that we can help people find experts who are willing to answer questions about SharePoint the way we do this is with a query rule so site settings query rules and in this case we're searching on local SharePoint people and I'm going to create a new query rule and we're gonna call this one expertise I don't care what people are searching for so I'm going to remove the condition because this is gonna fire if there's a match I'm going to add a result block and I'll explain what a result block is in a moment visually but just suffice to say this is a set of results that it's going to float inside the exact results for the query that you entered in a manner in a title of people who know about the subject term the term that you're searching for in our case SharePoint so I'm going to launch the query builder and I'm going to execute this search against local people results and I don't need this subject term because we're going to completely change that the the query for our end user and you can use this little property checkbox property drop-down while you're getting used to constructing your own queries and in my case the first thing I'm looking for is responsible so we're gonna go to responsibilities contains a value of our subject terms and I'm going to add that property filter and then I'm going to add skills as well because I want it to be both I wanted to check both fields so we'll add skills as well now you need to amend this query just a little bit in fact what I'm gonna do is take out these intervening curly braces so that it starts with a curly brace in a question mark now that's important because that means that this query won't fire if subject terms is null we've got responsibilities or skills matching the subject terms so if I test the query I should get no results here because we have no subject term I go to the test page choose show more and I can put in my subject terms so let's put in I don't know SharePoint we'll test our results and we get results back notice that Hank is not present there because he didn't have it in his skills I do know that Hank knows something about mud though so if I test that query I get Hank back so therefore somewhere in either the responsibilities field or the skills field he has mud and that makes him the perfect match for that query i'ma choose okay and I want to make this look a little bit different so there's two things that I'm gonna do the first one is I'm gonna change the result type to people intent this gives me a nice horizontal small view but the other thing I'm going to do is change this result block is always shown above the core results now I do this for demonstration purposes because I want it to show up right at the top but the default is important to recognize this block is ranked within the core result and it made show what that means is that it floats within the relevance of the other results that are in the results page and if it ends up on page 10 then it may not show so a lot of times you're not gonna want to pin all of this stuff to the top because it may not be the most relevant result that you're trying to present but in the case of our demos I am going to choose this so that it makes it easier for you to see that we found this thing I'm also going to change this to four that way we get four people back at most I'll choose save I'll go back to my site I'll search for SharePoint and I'll go to the people tab and once I'm on the people tab what I should see at the top is my experts after just a moment let's try it one more time here yeah they are so notice it says people who know about SharePoint so we found people who if I go to happy here we come here and on just on happy skills she has SharePoint so therefore I'm finding people who are actually opting in to answer questions about it and if you're wondering what happened to Hank he's right there under mud because he has asked me about mud fetching and swimming so that's a way to allow your end users to be able to search for something and you can focus you can target that search to specific properties inside those search results so in our property query example we used a result block we took out the condition because we wanted to apply anytime there was a match then we used that colon as it contains query for skills and responsibilities and here is the exact query that we used now if you had other properties you wanted to search on you would simply swap out the word skills and responsibilities for the manage property that you are interested in now what if you are working a large organization and you do a search for somebody or you do a search for a user profile but you want to return the users that are in your department in other words whatever department you're in you want the people who are in your department to be more relevant or in a separate result blog from the other users also this is a way that you can make the end results a little bit more personal because you're using information about the asker to drive the query that's going to return them results you can also help users find people in their department to help them and the way that we do this is using something I call a user query so in this scenario we're going to be looking for people who are in my department if I do that same search that I did before for SharePoint and jump over here to the people tab assume that we're a very large organization now if I'm running this query as a ruby down here and ruby is in the search services department so what we can notice is that there are other people that have SharePoint on their profile but they're not all in search services for instance some hanker is in SharePoint services and so is Cheyenne Joely is down in information technology so what I want to do is find somebody that's in Ruby's departments and have that expert show up here and so we're going to use a little bit of what we know about Ruby to construct a query to help her find people close by I'm going to go into site settings and I'm going to go into query rules and I'm going to choose our people result source and what you'll notice right away is that I did disable the rule the expertise rule you don't have to do that but I do that just to make the demos a bit more clear I'm going to choose a new query here we're going to call this one users in Department again I really don't care what the query is what I do care about is that the the information about the end user is added to the query for the result block so I'm gonna find users near you now obviously it's not geographically near you but it's departmentally near you and then we're going to change the query so there's properties that tell me a little bit about the user based on their user profile and the first thing I'm going to look for is the department the department contains something that I know about the user now this drop-down is not perfect it has the name of the user who runs the query but I'm going to show you that as long as you know the property names you can just come in here and change them so in this case we're looking for the users Department so we use user dot Department as the search term so now I've got whatever the subject term is plus the end result has to have a department value that matches the users department now if I do just that then if Ruby's user profile is part of the result set then she will show up too and clearly she's looking for help so we're not going to do that we're gonna exclude Ruby and we can do that by grabbing the user profile globally unique ID and then we're going to make sure that it does not equal the current users user profile' good so by executing this query we will exclude ruby but will include everybody else so we can do that you come in here the search terms are obviously automatically ANDed together and then I can come over here and make sure that it's those two things and let the users global unique ID does not match and then the last thing I need to do is make sure that this query is coming from local people results I can test that query it brings back Joely Joely is a good example of someone who's not in my department if I come over to the test page and I do a search term here for SharePoint I should see everybody but Ruby so I test that it works I can check for Underhill recovery and test that and it brings back folks the main thing here is I'm looking to see that it does not bring back Ruby and it doesn't so I'm happy with that so I've got users near you we're gonna change that one setting I told you about earlier we're gonna make sure it shows up at the top and we're gonna grab our users here and choose it people intent items I like the way that looks and we can choose okay come back here now remember before we typed in SharePoint and on the people page we got people but now what we get is people who are in Ruby's department so remember Ruby's Department is search services so if we go to people we've got users near you who know SharePoint and notice that both a Cobie and wriggly are part of Ruby's department so she knows two people close by that she can contact but if I change users if I change users and here I'm logged in as oh so and I search people for SharePoint I should get a different group of people and in this case in this case he doesn't have anybody in this department that can help him out but he's in sales so let's try marketing and there you go oh so found Ralph who knows marketing in his department so this is a simple way for you to allow end users to find people close to them by using a structured query that pulls from a little information about the end-user who's executing the query and applies it as a global query so in our user query example we did another result block we took away that quint condition because we're gonna apply this to any search and then we use the user dot property syntax to get the information about the person asking the question the person who is executing the query in our case we use the user dot Department and the user profile grid to be able to tailor that query to be able to help people find people close to them in this next example we want to do a swap when a user searches for this word they actually meant this other word or you work in a company where they use a lot of jargon but that jargon doesn't show up in the document so the TPS report isn't called a TPS report at least the letters TPS aren't found in it again this comes back to our searchers our users aren't searching the right way they're using company jargon instead of using actual terms that are in the documents that they're searching for so I call this a user intent query and this one is a super cool way of helping your end users find content and really tailoring the search experience for your company if you were to meet me at a conference and you saw a search presentation that I did you might ask me for my PowerPoint file on SharePoint search but you wouldn't usually ask it that way you would ask for it by the term that we use in the industry called Dec a SharePoint Dec SharePoint search Dec is the same as a PowerPoint file and SharePoint knows that so if I do a search for the word Dec SharePoint will remove the word Dec and do a search for SharePoint search that is found in PowerPoint files likewise SharePoint knows what a docx is and so if I do the same search for SharePoint search doc I find the governance plan because it has the term SharePoint search in it and it's a Word document now you'll notice that it also ran the query against all sources using that word doc and there is a word doc here but is not in a Word document but this is called a user intent query these are intended to search for documents so in our organization we produce these little video clips and so if I go to Ruby if I type Ruby here and jump over to videos I'll see that I have these videos that show up for Ruby but in our in our parlance in the jargon of our organization we call these flicks and if I search for flick what I should find is I should find ruby videos but instead I just find the one deck on how to create a flick and that's not very helpful so what I want to do is create a user intent query that results in the discovery of video content when we use the keyword flick I'm gonna go to my site settings I'm gonna go to query rules and I'm gonna choose my local SharePoint results I'm going to create a new query rule and I'm going to call this one video intent now in this case I'm going to choose query contains an action term the action terms are going to be semicolon delimited so I'm going to choose flick and flicks plural and then filk because I always spell it wrong and then I'm going to come down and add a result block now notice in the query variable section here it says the search box queries the original query that's ruby flick the subject terms are the unmatched terms that's Ruby the action term is the match terms for example flick so now I'm going to change this to video results for whatever we were searching for that would be Ruby and then I'm gonna launch the query builder and I'm going to change from the queries original source to local video results now when I add when I do the test query I find all of the Ruby videos so with that done I can choose okay I'm gonna change this to let's say four items and instead of using the out of the box display template we'll go ahead and choose a video item to make it look good so we'll choose OK there and now we've got that setup I can come back up here and choose save and I can go back to my search and I can search for Ruby flick and it says video results for Ruby and this video intent item is nice because it gives us a nice presentation of that of that video but let me show you what we can do with the more link because right now there's nothing else down here so let's go to the video tab and let's take Ruby flick off of here and now what I can do is copy this copy this URL and go back to my rule I'm going to edit my rule and in my result go into settings I'm going to add this more link and so watch how we do this now if I do nothing else but leave like this with K equals Ruby then that would force that search result to always be Ruby which would be kind of silly so instead we're going to use the subject terms I'm going to go to the end and place it right there so now I'm going to send them to the video results page and I'm going to pass that subject term so that it forces the result to occur as soon as they switch tabs which is what everybody expects so here we go again ruby flick hit the button it says here are my local video here my video results for Ruby then down here it says show more click on show more and it takes us to the video results tab with just Ruby and list this is a really nice way to get your end users moving between tab moving from one search vertical to another it kind of helps them understand how the user interface is built too so for our user intent query we did another result block but this time we used a query contains an action term and then we chose the action term to use and then we change the query and added the more link that allowed them to move from one search vertical to another inside our search user interface our last example helps users find what you consider to be the most important content it's another way to possibly promote content it's the way that I'm gonna teach you is kind of like using a sledgehammer to solve the problem but I want to show you just how much control you have over ranking results if you choose to use it this is called a Content boost or boost query in this scenario we have a really important list that contains information we want our end users to find so if I do a search for Austin what I see is I've got some documents here I've got how to implement search I've got people up here's our frequently asked questions list that's what I want people to find so what I'm gonna do is I'm going to copy the shortcut to this list and we're gonna create a ranking rule that promotes the content from that list so just remember that that Lumia and how to show up at the top right now I go to site settings and down into query rules and we're going to call this one let's call this one content FAQ boost FAQ boost now again I don't care what the condition is I just care that my query gets executed so I'm going to choose this time change ranked results by changing the query and go off our can our original source and in this case what I'm looking for is anytime any of the content comes from that list which would mean that the path to this item contains that FAQ list so I'm going to say any of these items that are on FAQ star and I'm also gonna make sure that it's it's important enough that it shows up in the title in other words the word Austin would have to show up in the title and so this is where we're going to enter our search terms in there as well so if it shows up in the title and if it's in our FAQ list then I want to do something special here and so this is the sledgehammer I'm going to come in here and put in the question mark to make sure that if this is only going to execute if it's not no and I'm gonna do an X rank and I'm gonna do a Content boost of a hundred for any Content that matches this query so I've got my X rank content boost equals 100 I've got the path and then I've got the title search terms let's put some quotes around this and let's test that query then let's go up here to test show more type in austin test the query and notice how do i change my password is above lumia cells out so we got our faq hit showing up above our Lumia sells out that's what we need so I'm going to choose save and then we'll come back to our search center and do that same search for Austin and we've altered the rank of the results in that list when it matches something in the title which means it's pretty darn important now as I said this is kind of a sledgehammer if that list was as important as you say and after a week or two of people searching for things and finding them they'll ultimately show up on this first page just through the the nature of how SharePoint learns about what's important to your organization but if you need to alter that if you need to force these results then that's one of many ways to use X ranked to get the results to show up at the top so for this example we change the rank of result by changing the query we used a query contains the terms but when we use those search terms we also add the x rank property to force a promotion of a hundred to anything that matched our title and like I said this is usually not necessary but it does demonstrate the very powerful capability of query rules so I wanted to leave you with a few references the first one is my search class from Pluralsight it's still relevant it's related to a SharePoint 2013 but still totally works in SharePoint 2016 there's also a fantastic site but one of my friends Agnes molnár called Search explained and she also has search explained on Yammer if you have search questions or you're interested in an additional search content great source if you want to learn how to write your own queries Michaels fencin has written an amazing book called SharePoint search queries explained fantastic resource totally worth the money and then finally an oldie but a goodie my SharePoint 2013 search display templates and query rules from SharePoint conference 2014 75 minutes just on query rules and display templates lots of fun I'd like to thank you for your time and watching the video I hope you enjoyed it if you have any questions please contact apt Alon and we'd be more than happy to help you find the information you need and get some great consulting resources
Info
Channel: Aptillon Inc.
Views: 9,402
Rating: undefined out of 5
Keywords: Search, Query, Aptillon, SharePoint 2016
Id: eflkMCmORuo
Channel Id: undefined
Length: 30min 30sec (1830 seconds)
Published: Wed Apr 12 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.