Skip to main content
< All Articles

How SharePoint keyword search works

Posted on June 8, 2017
SharePoint

Anytime you type in the query into SharePoint search box, you get what I call Google-style search results – content that matches the keywords you typed in. But how does it really work, what is being searched and why do results look different for different users? This post will answer these questions.

The below material is based on few very important assumptions:

  1. Assumption 1: This post explains how an Out of the Box Search works – that means that no customization has been done to your environment that would alter the search results in any way.
  2. Assumption 2: This post essentially explains the behavior of the Search box you can find in the upper-right-hand corner of every site. If you search for content from any other area of Office 365 (i.e. Delve, SharePoint Home or OneDrive) – those search experiences are based on a different concept called Intelligence-based search and they do work differently. I will explain those search mechanisms later on, in a different post.

Sharepointkeywordsearch1

What type of content is being searched?

Any type of content that meets the criteria. That includes documents, files, folders, contacts, events, tasks, pages, web parts or complete sites.

With the documents, where does it look?

With the documents, the keyword or phrase typed in is matched against the file name. In addition, the search mechanism searches inside of the file as well (as long as it is an MS Office File, like Word, Excel, PowerPoint, etc.). It also searches within PDF documents, assuming it is a text-based PDF. In other words, if you scanned a page into PDF, it won’t pick up on the text (unless you do OCR – Optical Character Recognition).

Sharepointkeywordsearch2

Search performed for keyword “vehicle”

SharePoint keyword search

Where does it search?

That’s a tricky one. You might need to sit down for this one and grab your favorite martini and a cigar. The search results differ depending on where you are searching from:

Scenario 1: Search from any site  in SharePoint (with the exception of the top-level site of a default site collection)

  • A search initiated from any site of any site collection (with the exception of default site collection root/top site) will display results from the site you are initiating the search from and all of the subsites underneath. Sharepointkeywordsearch5
  • After the above results are displayed, on that same search results page, it offers to expand the search to Everything. When you select Everything – it performs a search for the same keyword, but across the WHOLE SharePoint. That means all sites AND site collections that exist (and that you have access to – search results are permissions-based)Sharepointkeywordsearch4
  • This is what the search results look like when you choose Everything Sharepointkeywordsearch6

Scenario 2: Search from a custom site collection

  • Search initiated from any site of a custom site collection works just like described above – will display the search results of a site you are in + subsites underneath
  • If you execute your search from the root (the very top level site) of your custom site collection – you will get the search results from the whole site collection you are in (since you are at the highest point of a site collection and will get all of the subsites underneath)
  • Same as above, the default search will display results, but will also offer you to do global (Everything) search, which will encompass the whole SharePoint environment (all site collections)

Scenario 3: Search from the root of a default site collection

  • The search that behaves little differently is the search executed from the root (top level site) of your default site collection (companyname.sharepooint.com – usually your Intranet Homepage).
  • If you search from that site (and that site only), the search results will be displayed from ALL site collections and subsites by default. Essentially you get “Everything” search by default, without an additional selection. Sharepointkeywordsearch7

Why are my search results different from my colleague’s search results?

Search in SharePoint, just like Navigation, is permission driven. That means that results are only presented from the sites you have at least Read Only access to. If you don’t have access to a site (say HR team site), you will not see any results from that site. If you want to learn more about permission driven concept – click here.

Can I do a wildcard search?

Yes, you can. You can use the star “*” for wildcard search. For example:

  • Typing sea* will return results that contain the letters preceding the wildcard character – like sea, seal, search, seat, etc.
  • The search box allows to type in searches using Keyword Query Language (KQL). To read more about the topic, check out this excellent reference from Microsoft.

About Me

I’m Greg Zelfond, a U.S. based SharePoint consultant, and I provide affordable out-of-the-box SharePoint consulting, training, and configuration assistance to small and medium-sized businesses all over the world.

Need help?