How to search in SharePoint

How to search in SharePoint

Content type Blog Post
Author Matt Wade
Publication Date 15 Apr, 2017
Reading Time Less than 1 minute

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”.

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.

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.

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.

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

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).

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.

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:docxfiletype: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.

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.

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

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.

References:

icansharepoint. (2016). How to search in SharePoint – icansharepoint. [online] Available at: http://icansharepoint.com/how-to-search-in-sharepoint/ [Accessed 12 Apr. 2017].

Msdn.microsoft.com. (2017). Keyword Query Language (KQL) syntax reference. [online] Available at: https://msdn.microsoft.com/en-us/library/office/ee558911.aspx [Accessed 12 Apr. 2017].

Reproduced under permission from Matt Wade