You may be surprised to find out that dumping some words into a SharePoint search box and pressing enter is actually the minimum you can do to get search results. SharePoint search comes with a bunch of additional features that let you enhance the quality of your search query and consequently will garner you a much better list of results.

 

You have the power to improve your own search results by learning how to master the tools that are built into SharePoint. Going forward, I’m assuming you generally know how to use the SharePoint 2013/2016/Online search interface.

 

The guidance in this post is more advanced than simply using the out-of-the-box search interface. It also doesn’t affect the searchability of a file (that’s a different post), only how to get the most out of the search query itself. This post is about how your search query—the text you drop in the search box—can improve the search engine’s output.

 

So, let’s talk about some of the most efficient options you have at your disposal.

 

This post is available in infographic format by clicking below.

how-to-search-in-sharepoint-icansharepoint-700px-cropped

 

An example smart search

By the time you finish reading this post, you’ll understand that the following search query…

example-search

…is equivalent to this human request:

I’m looking for the new HR benefits overview. It’s a PDF file posted by a woman in human resources with the last name of ‘Matthew’ or ‘Matthews’—I can’t remember which—that features the words “benefits” and “insurance” a lot. Oh, and I want the current version, so don’t give me the 2015 copy.

 

What SharePoint searches

First, it’s important to know what SharePoint even looks at. SharePoint’s search engine goes through all sites, pages, wikis, lists, libraries, folders, and files in SharePoint.

 

SharePoint searches full text of documents, plus their metadata. Metadata includes the file name, title, author, and any keywords or category systems you’ve put in place. Metadata ranks higher than full text to the search engine. (Unfortunately I can’t tell you how much more value the engine places on metadata because Microsoft doesn’t reveal that proprietary information.)

 

Search results only display the content you have access to. In the SharePoint world, we call this “security trimming”.

 

How security trimming works in SharePoint.

SharePoint only returns results that are indexed. “Indexing” is when the search engine goes out and finds everything in the system—or crawls—and makes a record—or an index—of it.

 

Generally, most, if not all SharePoint content is indexed. But if you’re not getting results you expect (i.e., a file you think should show up in your results doesn’t appear at all), indexing could be the problem. In that situation, you should raise the issue with your IT department.

 

Where do you want to search?

It’s important to know where you’re searching. You can get better results simply by searching only in a particular site or library, rather than defaulting to searching “Everything”. This is useful if you know the site or library where that file lives, but you can’t seem to find it quickly by browsing or skimming through files.

 

Why? Because by limiting your search to only a site or library, you immediately remove any extraneous results that live in other sites but may still match the words and phrases you use in your search query.

 

Global search boxes let you search “Everything”, “People”, “Conversations”, and “This Site”. Choose the appropriate one. Note that if you choose the “This Site” option, it searches the site you’re in, plus all sub-sites below that site, which means your results could be more wide-ranging than you might have intended.

global-search-box

Document libraries each have a search box and return results directly in the library. The results are basically a filtered view of the library content based on your input terms; you don’t actually go to a search results page. Type your search terms in the “Find a file” box located to the right of the view names.

doc-lib-search-box

 

Use advanced search

SharePoint offers an advanced search page, but it’s not an obvious feature. Advanced search lets you include logic in your search without having to type out search operators. If you’ve never tried advanced search, it can help you pare down your results to be more appropriate, especially if you’re not comfortable using search operators.

 

blank-advanced-search

There’s no direct link I can tell you will get you to your advanced search page. It depends how your admins set up your search system. The easiest way to get there is to search Advanced Search in a search box set to search “Everything” and it should be the top hit. I know, so meta.

 

Another way to find the advanced search page is to scroll all the way to the bottom of any search results page and click Advanced Search.  If you’re using SharePoint Online, it’s likely that your advanced search is at the following link: https://[domain].sharepoint.com/search/Pages/advanced.aspx

 

find-advanced-search

 

Favorite/bookmark that page, and maybe ask your IT admins up to include a link on the corporate home page for quicker access.

 

Continuing with the example shown at top, here’s how to get the same search (actually, a bit better), using advanced search. In this case, the search will return results that meet the following requirements:

  1. Contain the exact phrase “human resources” AND
  2. Contain the word insurance OR benefits AND
  3. Your results will exclude any files that contain the text 2015 in them AND
  4. The results will only display documents (PDFs or Word docs) AND
  5. The last person to modify the file has “Matt” in their name somewhere (which will return someone with the last name of “Matthew” or “Matthews”) AND
  6. This search will limit results to files that were last edited between 1 January 2016 and 28 February 2016 (because let’s assume you know the file was last uploaded or edited in January or February 2016).

advanced-search-completed

And yes, I agree that if you’re working in a SharePoint system with people who only work in one language, it’s annoying that the language option takes up so much space. Out of the box, you’re stuck with that.

 

Search operators

You can improve your search queries by introducing Boolean and other operators, which give you different options on how to limit or broaden your search.

 

searchoperators

 

Two symbolic operators will likely be the most useful:

  • Quotation marks: Any words within quotation marks will return results that include that exact phrase, in that order. For example, this is useful when looking for files that contain the phrase health insurance. If you simply search those two words, you will return hits that contain both words, but they needn’t be in that order or anywhere near each other. However, if you search “health insurance”, your results will only include hits that include the exact phrase health insurance. Quotation marks limit your search by dropping extraneous and irrelevant results that you don’t actually want to see.
  • *: The asterisk symbol, known as the search wildcardbroadens your search by returning results that include variations on the given term. Searching edu* returns results that include educateeducationaleducation, and any other words that begin with edu-.
    • Wildcards can only be used at the end of a word. You cannot begin a word with a wildcard. For example, you can’t search *smith in hopes of getting results that include blacksmithgoldsmith, silversmith, locksmith, and the like. But you can search smith* to get results that include Smith, Smithson, Smithsonian, and anything else that starts with Smith (likely a lot of people names).
    • Wildcards can only be used at the end of an exact phrase search. You can’t use a wildcard at the end of a word that isn’t the last word in an exact phrase search. For example, searching “human resource*” will return any results that include human resource or human resources. But “human* resources” will not return results that include humanity resources.

Boolean operators let you combine terms, search multiple terms at once, and exclude terms. They must be all caps, otherwise they’re assumed to be terms that are meant to be searched. Include the operator between words or phrases to call them out. They are:

  • AND: Limits your search by finding results that include both terms. Searching human AND resources returns results that contain both words. You can include multiple AND operators in a single search query. AND is rarely used because a space between two words in a search query is equivalent to an AND. That is, searching human resources is equivalent to searching human AND resources. But it’s good to know.
  • ORBroadens your search by finding results that include either term your supply. Searching human OR resources returns any results that contain either word. This is useful for finding content that might use synonyms, like searching college OR university. You can include multiple OR operators in a single search query.
  • NOT or Limits your search by excluding results that include the specified term. Searching NOT insurance or -insurance in a query that contains other search terms returns results that do not contain the word insurance. Or, put another way, your results exclude any files that contain the word insurance. It’s kind of like filtering out a keyword. You can include multiple NOT operators in a single search query.

So, taking that in, this is a perfectly reasonable search query: budget OR finance OR revenue 2017 –draft –2016. This query would return content that contains any of the first three words budgetfinance, and revenue, and includes 2017 somewhere in the file, but doesn’t include draft or 2016.

 

Searching by properties

You can filter your search results by searching only certain properties associated with a file you’re looking for. This is especially useful when looking for certain file types. The result page refiners (see next section) are helpful in filtering to a single file type, but if you want to find results that are either Word documents or PDFs, searching by the file type property is a way to go.

 

There are a number of property types you can choose from, but they get really complex really quickly. So I’ll stick to the most useful ones for an everyday search.

  • Title: Searches the Title field of a file.
  • Filetype: Returns results of a certain file type. You’re not limited to Microsoft Office file types, either.
  • Author: Returns results that were edited or created by whatever name you’ve input. Spelling counts here. This is also a good place to use the wildcard symbol in case you’re unsure of spelling or whether a name is a given name or surname.
  • Various dates:  You can restrict your search results to files that were created or modified within various date ranges. You should check this article out for more info. Personally, I find either the advanced search date fields or the refiner on the results page much more useful for searching by date than using this property.

The format for searching by property is to type <property><operator><search term>. The operators include:

  • Colon, :, which basically means “is equal to”
  • <>, which means “is not equal to”
  • <, which means “less than” (useful for dates)
  • <=, which means “less than or equal to” (useful for dates)
  • >, which means “greater than” (useful for dates)
  • >=, which means “greater than or equal to” (useful for dates)

Some useful examples:

  • filetype:pdf returns only PDF files in your results
  • filetype<>pdf returns all files types except PDFs in your results
  • author:”John*” returns files created or edited by anyone who has John in their name, which includes men named John and anyone with the last name Johnson.

You can include multiple property searches. For example, this is a completely acceptable search: finance report filetype:docx filetype:pdf author<>“John Smith”. This will return any PDF or docx files not authored by John Smith that contain the words finance and report.

 

You can mix properties with Boolean operators, too. For example, if you want your results to exclude PowerPoint slideshows and MP4 video files from your results, you can include –filetype:pptx –filetype:mp4 in your query.

 

There are more properties and operators available to use, but they get complex. Feel free to check them out here.

 

Results refiners

Once you get to the results page, refiners become the most powerful way to improve your results. Refiners allow you to filter your results by excluding extraneous file types, date ranges, and authors.

 

Choose the author or file type you want to see results for, or move the scale on the modified date range. This helps clear out useless results and gives you significantly better possibilities for what you want to find.

 

refiners

The date refiner is logarithmic. Well, sort of; it’s definitely not linear. The points on the scale aren’t separated the way you might think. It works as shown below.

 

modified-refiner

 

Additional search refiners can be set up by your IT department.

 

Searching within your results

Sometimes you want to find exactly where your search term appears in the result that looks best. Unfortunately SharePoint doesn’t show you where the terms appear except in the preview shown on the results page.

 

Open the result and press Ctrl + F on a Windows machine or Cmd + F on a Mac. You will be given the find field in the application that opened the file. Unfortunately you’re limited to searching single words or exact phrases. Sorry, that’s life.

 

Search alerts

Sick of having to repeatedly input a complicated search query to see if your results have changed? The next time you search, scroll to the bottom of the page and click “Alert Me”. Get a SharePoint alert whenever the results page changes or the content within the results themselves have changed.

 

Getting better results

Not satisfied with the results you see, even after using the advice above? The best search results only come when everyone creates and edits files in a search-centric way.

  • Try “Did you mean?” suggestions. SharePoint gives you a best-guess suggestion if it thinks you meant something else.
  • Delete outdated and redundant files. Just do it.
  • Use a descriptive title in the Title field. (Note: don’t mix this up with the file name field.)
  • Organize files using metadata, categories, and keywords then search by those.
  • Use unique (let’s face it, sneaky) phrases in your documents that you know won’t exist elsewhere. They’re much easier to find if you know the “code phrase” you inserted previously.

Conclusion

If you jump back to the top of this article, you should now be able to read and repeat the steps to make that smart search query. This is super handy no matter what you’re searching. Plus, a lot of what you learned here in this post is applicable in Google and Bing. Check out this great article, called How to Google It for more info.

 

Notes

  • A library’s Title field has the most weight of any metadata when using SharePoint search.
  • The text you enter in a search box cannot exceed 2,048 characters (including spaces).
  • Search queries are not case-sensitive. The exception is search operators (AND, OR, and NOT) must be all caps.
  • “Sharepoint” is not a good search term because it’s in all SharePoint Online URLs and companies are likely to use it in their on-premises domain as well, e.g., https://sharepoint.company.com/
  • An underscore is a valid word separator in SharePoint 2013 and up. 2017_Budget_Draft.xlsx will come up when searching 2017, budget, or draft. For more information about underscores, spaces, and hyphens in file names, read this blog post.
  • When you have questions or concerns about your search results and you want to talk to IT about it, you have to show your IT admin what your results look like; your IT admin likely has access to everything in the system and therefore their results are enormous (lots of content to return).
  • SharePoint can’t search the content of multimedia, which means it can’t find a video based on a search unless the transcript of the video is included as part of the file’s metadata. Likewise, scanned PDFs that didn’t use optical character recognition (OCR) when scanned won’t come up in search results unless the metadata matches. SharePoint sees a scanned PDF as an image and won’t return full-text results because the content isn’t text, it’s graphical.

 

The main source for this post is this MSDN article. But save yourself, it’s super technical and jargony. I incorporated only the most useful stuff for the everyday user.

Leave a comment

How to search in SharePoint