Skip to main content

How to use Boolean Operators in SharePoint Search

Today I want to introduce you to a trick that I hope will make your SharePoint search results more relevant. As you migrate all the content from file shares and other cloud platforms, SharePoint becomes THE go-to place for all the documents, knowledge base Wikis, and other content. And given the exponentially growing amount of content, it becomes super important to find exactly what you are looking for. So with this post, I would like to introduce you to Boolean Operators in SharePoint search and explain how they can improve your SharePoint Search experience.

What are Boolean Operators?

In simple words, Boolean Operators are words that connect other words (keywords). The most basic Boolean operators are AND, OR, NOT. Reference this post from MIT for a helpful explanation.

  • AND: searches content for the presence of both Keyword 1 and Keyword 2 (both must be present)
  • OR: searches content for either Keyword 1 or Keyword 2 (any must be present)
  • NOT: searches content that contains Keyword 1 but does not contain Keyword 2 (just Keyword 1 should be present)

Example

Say the document contains keywords Red and White.

  • Scenario 1: When you search for Red AND White, it will find the document, because both words are present in a document
  • Scenario 2: When you search for Red OR White, it will again find the document, because any of the words are present in the document
  • Scenario 3: When you search for Red NOT White, it won’t find a document, because the document contains the word “White”

What does SharePoint Search

Before I explain how Boolean Operators work in the context of SharePoint, it is important to understand how SharePoint search works. When you type a keyword into a search box in SharePoint, it searches the following:

  • File Name
  • Folder Name
  • Metadata
  • The text inside of the documents

The reason I mentioned the above is that when we search for keywords in SharePoint, it could search any of the fields. So, in other words, using the examples above, Keywords could apply to the File Name or Text inside of the document or Metadata.

Boolean Operators in SharePoint Search

Important Notes

Examples

To demonstrate Boolean Operators in SharePoint Search, I will use a Document Library with a few files:

  • Document 1 includes 3 keywords: Red, White, Blue
  • Document 2 includes 2 keywords: Red, White
  • Document 3 includes 1 keyword: Blue

Scenario 1: AND

Boolean Operators in SharePoint Search

Only 1 document contains both of the keywords, so the result above is expected

Scenario 2: OR

Boolean Operators in SharePoint Search

All 3 documents happen to have either of the keywords, so all 3 come up

Scenario 3: NOT

Boolean Operators in SharePoint Search

Only 1 document contains the keyword Red without containing the keyword Blue

You may also like

4 Levels of Search in SharePoint Online

April 23rd, 2020

You may also like

How to track documents in SharePoint using Document ID feature

September 17th, 2019

You may also like

How to roll up content from SharePoint sites using Highlighted Content Web Part

June 5th, 2019

Need SharePoint Help?

Hourly consulting, training and configuration services are available

Learn More