Search for Synonyms in Office 365 SharePoint Online

Summary: In this article for SharePoint administrators, site owners and content owners, learn to use search operators in combination with query rules so that your search results contain common variations and acronyms of common search terms.

How can you predict what your user will search for? What if they search for an acronym, or the long version of the acronym, or a localized version of a word? Or, what if you work for a global company and there are slightly different variations for different languages?

For example, what will be returned in search results if a user types any of the following?

  • Television, TV, Tellie, televisie (Dutch)
  • Sales & Marketing, Sales and Marketing, Sales, Marketing, SAM
  • EPIC, Event Planner Information Center, Event Planning Tool

Ideally, if a user types any of the terms listed on a single line above, the results should return the same number of results.

I love the fact that you can help users find stuff with synonyms in SharePoint:  Create and deploy a thesaurus in SharePoint Server 2013.   What I DON’T love is that the thesaurus has to be uploaded with PowerShell for on-premises SharePoint, and is not available for SharePoint Online: SharePoint online Search thesaurus for synonyms.

After a little bit of research on operators and how to search…problem solved! In addition, this solution works for both SharePoint Online and SharePoint on-premises, which means that you can emulate a thesaurus without PowerShell or access to Central Admin.

The short version

Print screen of adding a synonym for Managed Metadata

For terms that are not managed terms, you can emulate a thesaurus by creating a query rule that uses the WORDS search operator, i.e. WORDS(word1, word2, word3), which will be the focus of the rest of this post.

The long version

There are two concepts to understand here:

Below, I will walk through an example that shows how to use search operators and then how to use a query rule. I will use the Contoso demo environment (which most SharePoint IT people are familiar with). In figure 2, you can see I searched for “Television” and SharePoint returned 3 results.

Searching for the word "Television" yields 3 results

Figure 2: A simple Contoso search for the word television without search operators.

Then I searched for “TV” and SharePoint returned 17 results.

Searching for the word "TV" yields 17 results

Figure 3: My search of Contoso for TV returned more results.

Then I entered a search with the “WORDS” search operator in lowercase letters and SharePoint returned 1 result.

Use Operator with Words in Wrong Case

Figure 4: Here I did not use the search operator in all caps and I got just one search result. As you’ll see in figure 5, case is important.

Why…didn’t I read the referenced article above that clearly shows search operators should be in all caps? Of course I did; I just wanted to show you the importance of making sure search operators are UPPERCASE. Moving on now….

I then did the same search, but with uppercase operator “WORDS” and SharePoint returned 19 results, (the difference in 17 + 3 is accounted for by 2 documents returned in search results that contain both “Television” and “TV”).

Result of conducting an Operator search with the Correct Case

Figure 5: Same search with an uppercase search operator returns more results.

That’s great, but who wants to be in charge of teaching all your users how to use search operators???

That’s where Query Rules come to the rescue! I simply go to my search settings and create a query rule and voila!

  1. Go to Manage query rules.
Search Setting Create a Query Rule link

Figure 6: In SharePoint Admin Center, choose Manage Query Rules.

  1. Select a Source from the drop-down menu and then click New Query Rule.
Selecting a source and clicking on New Query Rule button

Figure 7: Choose the context for the query rule and then click New Query Rule

  1. Enter a Rule Name. For this example, we’ll call it Television.
  2. In the Query Conditions section, choose Query Matches Keyword Exactly from the drop-down menu.
  3. Enter each term that you want to be included as a synonym (my example shows the words “Television” and “TV”) separated by semi-colons.
  4. In the Actions section choose Change ranked results by the changing the query and add WORDS(Television, TV) and save the rule.
Creating a Query Rule with the WORDS operator

Figure 8: Creating a SharePoint query rule that contains the search operator we used earlier.

Now I will go to my page and search for Television. Remember that the previous result returned 3; but now I get all 19 results that include Television or TV.

Result of Television Search after Query Rule shows correct number of results with TV and Television

You may be asking yourself, “Do I need to create this rule at the Central Admin / Tenant Admin or on the Site Collection? My answer is, “It depends!”

If you want this to apply to all searches in your company, then add it to Central Admin/Tenant Admin. Or, if you only want it to apply to your site, or your Search Center, then add it only on that specific site collection.

*Note on results source from that drop-down menu in step 2. In Office 365, I’m unable to apply a rule to all sources. Microsoft Support says this is by design. I’m investigating this.

Archive: Out of the Box Content Management Options in SharePoint

This was originally written in August 2012.  It is being re-posted here for archival purposes

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Content Management is one of the most critical items that you can plan for when creating your SharePoint site.   A SharePoint with a lot of outdated content negatively affects performance, storage, backup/restore, search results and usability.  Using a process that will remove outdated content from your end-user’s view will make it easier to find the most current and relative content easier.

In order to get active content to no longer be visible to readers of your site, SharePoint 2010 offers the following options out of the box:

Scheduling Start Date and Scheduling End Date

These out of the box fields allow you to determine when your end-users will be able to view content that you have published to your site.   You must have versioning, approval and publishing features turned on.

Scheduling Start Date:  The options are to start Publishing Immediately or to set a date when the content should be published.  When a page is approved for publication, but the publishing start date is in the future, the site sets the content’s status to “Scheduled”.   When the start date arrives, the page status changes from “Scheduled” to “Approved”.

If you have no published versions of the page, this is a great way to create content and publish it later.  However, if you have a published version and set this field to a date after <Today>, the content will no longer be available to the end user until that date…in other words, you cannot schedule an update to existing content.

Scheduling End Date:  On this date the content becomes a draft of the major publishing view with a version of published version number +.1.  The content can no longer be viewed by readers.

The Pros:

  • Allows you to complete the content in advance and pre-schedule when users will be able to view it
  • Automatically removes the content from user’s view without further action from the publisher

The Cons:

  • Only available with Pages, Document Libraries and certain lists.
  • End users will no longer have access to content past the “Scheduling End Date”
  • If you change the “Scheduling Start Date” for a published version, users will no longer be able to view any version of the document until the “Scheduling Start Date”
  • To change a Publishing Start or Publishing End date, you must check out the content, make the update, publish and approve.

o   Changing a document property changes the status to “Draft” and creates a new minor version.

Disposition Workflow:

This is an out of the box workflow that will only allow a user to choose whether the system should delete a piece of content or not to delete it.

The workflow can be configured to start automatically when content expires or started manually by authorized users.    In order to set an expiration date for automatically starting the workflow, you must use the Information Management Policy Settings to tell the site when the page expires.   More information about these settings are below.

The workflow will create an administrative task for review.  Individual tasks are not assigned and cannot send a notification based on “Assigned To”.  These tasks are able to be modified in large groups at once.   The workflow also includes bulk task completion so that individuals can process large numbers of items for deletion in one step.

ContentImage1-Workflow_Task

The options are to “Delete this item”, or “Do not delete this item”, which will leave the content in place.

In order to use this feature, it must be turned on by a site administrator.

The Pros:

  • Automated way to manage content
  • Content is permanently deleted from your site

The Cons:

  • No accountability – tasks are not assigned to any one person so it is a process that must be manually managed
  • No history – workflow tasks are deleted upon completion and no record of them exist
  • Content is immediately and permanently deleted from your site, along with the task and any comments a user may have entered when deleting the item – it does not go into any recycle bin.

o   Note:  If Auditing is enabled, this item would appear on the audit log

  • This workflow cannot be customized.
  • If you choose not to delete an item, the workflow will show that the item was run, but the task will be deleted, losing any comments.
  • This workflow does not show up in the “Site Workflows” view.

Information Management Policies

An Information Management Policy is a fancy way of saying “a set of rules for content to determine how long it should live on your server and what should happen to it after a certain amount of time”.   Policies are applied to Content Types and can be applied at the parent site level, a child site level or at a list level.   Each Content Type can have its own set of policies.

It is a best practice to define retention policies as a part of a governance plan.  Retention policies should be defined in order to maintain a healthy server over a long period of time.   Additional reasons for Information Management policies include some government rules and regulations or legal reasons.

A well-managed retention policy will allow you to determine what will happen to different content types based on rules that you can set up at the parent level and apply to the entire site collection.

Information Management polices include:

Auditing

Auditing logs events and operations that affect list items.  You can configure which of the following items you want the system to audit:

  • Item Edits
  • Item Views
  • Items Checked In or Checked Out
  • Permissions changed on an item
  • Document deletion

Access to the audit log is tightly restricted. Only administrators (or users who are granted sufficient privileges) are able to view the audit history, using Microsoft Office Excel-based reports. And no user can selectively edit or delete individual audit entries.

Retention

The “Enable Expiration” feature in 2007 has been upgraded to “Enable Retention”.  Many new features are included with the upgrade, such as allowing different stages of retention that you want to manage, allowing you to determine new actions and the ability to repeat the process until the next stage is reached.

Policies can be set up at a Site Collection level, a Site Level or a list level.  The Site Administrator can control at which level policies set up.

You can set the start date based on any date field contained in the content type.  For example, it could be 365 days after the default “Created” date or 20 days after a manually created “Review” date.   Unless an administrator sets up a custom expiration formula on the server that you have access to, the formula for determining the date will always be <Date> + # <days, months or years>.

ContentImage2-Retention

The Retention Actions available are

  • Move to Recycle Bin
  • Permanently Delete
  • Transfer to another location
  • Start a workflow
  • Skip to next stage
  • Declare a record
  • Delete previous drafts
  • Delete all previous versions

You can schedule how often an item goes through its current retention stage, based on days, months or years.

Some Noteworthy Retention Actions:

Start a Workflow (This can be used to start off an out of the box or custom workflow)

You can tell the site to start an out of the box workflow, or a custom workflow that is designed to do what you want it to do, including but not limited to:

  • Route the document to content owner to determine what should happen to the content when it reaches a certain date
  • Automatically change the item’s metadata

Declare a record

In place records management is a new feature that allows you to keep a document where it currently lives, but declare it a record.   In 2007, you had to move the document to a records site.   Some of the in-place records feature include:

o   You can apply different retention policies based on if is a record or not

o   Permissions do not change

  • You must have at least “Contribute” access to declare a record and the administrator must set up the ability for contributors to declare a record.
  • Viewers will still be able to view content that is declared a record unless access to the document is changed.

o   Declaring an item as a record does not affect versions

o   Collaboration site administrators can manage Record Declaration Properties:

Record Restrictions:

ContentImage3-Record_Restrictions

– No Additional settings: Authorized users can still edit records.

– Block Delete: Records can be edited by authorized users but not edited.

– Block Edit and Delete:  Once content is marked as a record, it cannot be modified until a user “undeclares” it as a record.

  • All options in the ribbon and edit menus  for edit/delete are disabled
  • Record Declaration Availability:

ContentImage4-Record_Availability

  • Declaration Roles: Who can declare or undeclared records

ContentImage5-Record_Roles

o   Manual record declaration can be configured on Site Collection level and overridden in each document library by authorized users.

o   After the content is declared as a record, it can have policies and restrictions that differ from the same content type that is not a record. The policies are added to either the Content Types at the parent, or they can be added directly on the document libraries.

o   The page or document has the following notification on it for editors that have the ribbon showing.  It does not appear if the ribbon is hidden.

o   Custom Workflows can be used to declare an item as a record

o   “Declared Record” property = Date/time the item was declared a record.

o   Views can be configured to exclude records or to only include them for an all-archived view.

  • Filters can be based on “Declared Record” = Blank for active events
  • For the Active view, filter on Declared Record equal to [blank] (as in don’t enter a value for the field). For the All Records view, set the filter on Declared Record not equal to [blank].

o   Declaring content as a “Record” does not change the page status.

o   The content is checked out to “System Account”

ContentImage6-Record_Status

o   You can start a workflow on a “Record”, but the actions will be based on the Record Restrictions set by the Administrator

To Undeclare a record, go to compliance Details and click “Undeclare Record”

ContentImage7-Record_Undeclare

NOTE:  If you declare a record multiple times, you will need to “undeclare it” the same number of times for it to no longer be listed as a record.  The timestamp will change each time you undeclare it if you declared it at different times.

When you undeclare a record, it removes the banner from the top and the date in the “Declared Record” property.

The Pros:

  • Automated way to archive content
  • Views are easy to create and change as needed
  • Different content types can follow different rules
  • Same content types can follow different rules based on if they are records or not
  • Site collection administrator can determine who can declare or undeclared records separately
  • Does not affect versioning
  • Any content can be turned into a record

The Cons:

  • All web parts and views must be filtered to exclude records
  • The yellow status bar text for a record isn’t the most user-friendly

Search Scopes still need to be determined.  However, if we cannot create a search scope on these properties, we can still include a “Status” field for search scopes

You will need to turn on In-Place Record Management feature in Site Collection Administrators to use this function.

To complete the list Information Management Policy feature, also available when setting up a policy:

Barcodes

This feature will automatically allow you to create barcodes for each piece of content.   This is most commonly used when for printing and attaching to an item for storage.

Labels

Labels can be applied when a document is printed.  Labels can include metadata about the content, with the exception of any calculated fields or built-in field, such as “CreatedBy”.