Microsoft 365

How to extend the search refinement panel in SharePoint Online with your taxonomy

The refinement panel was introduced with the release of SharePoint 2010. It’s a great extension of the SharePoint search engine. The panel enabled business users to filter through the search results. Figure 1 illustrates an example of search results.

x1

Figure 1: Sample SharePoint search results

Just imagine: Search returns hundreds of results, and you have to browse through 10 pages to find your document. Apart from being time consuming, that scenario is also frustrating.

The refinement panel is your Search buddy, and it’s here to help! With just one click, Word documents or PowerPoint presentations are displayed, and the results are narrowed down to  only 10 of the 250. You are now able to quickly find the document you are looking for.

The refinement panel comes with a pre-defined set of filters, but you can extend the panel. Let’s take a look!

Do you have a taxonomy in place that’s used to provide your content with metadata? The Figure 2 shows an example of a taxonomy.

x2

Figure 2: The taxonomy applied within the Contoso intranet portal

Let’s expand Accounting and Finance, as Figure 3 shows:

x3

Figure 3: The terms related to Accounting and Finance

The Contoso SharePoint Portal allows the business users to add one of the terms shown in Figure 3. For example, a user can add Commercial Auto Insurance to documents stored in document libraries. Every SharePoint Document Library contains a column called Document Category, as you see in Figure 4.

x4

Figure 4: Document Category

By clicking on the symbol, the business user can select a term to connect to the document, as shown in Figure5.

x5

Figure 5: Selecting a term related to the document

The refinement panel doesn’t include a refiner connected to the Document Category. You have to create one, so let’s get started!

The first step is creating a site column. It’s very important to create the site column at the top level of your SharePoint Portal. Otherwise the column isn’t available in all the SharePoint sites. Click on Site Actions, Site Settings, and Site Columns, as shown in Figure 6.

x6

Figure 6: Creating a site column

After getting slapped in the face (this is a figure of speech of course) by the developers in my team, I learned to remove spaces in the column name. Using a space results in annoying symbols (x0020) in the internal name of the column. This results in a lot of issues for future design and custom development changes. I recommend putting all the custom site columns in one group, as in Figure 7. This makes it easier to find a custom column in case you need to change the configuration.

jo1

Figure 7: Putting all the custom sit columns in one group

The final step is connecting the column to the Term Set, as in Figure 8.

jo2

Figure 8: Connecting the column to the Term Set

The column is now ready to be used within the SharePoint Portal. Did you connect the column to your Document Libraries? Upload documents? Assign metadata to the documents? Good!

Refiners are connected to managed properties. To create a new managed property, you need to be the Global Administrator of your SharePoint Online Portal because you need access to the SharePoint Administrator Center. Click in the top navigation on Admin and SharePoint as you see in Figure 9.

x9

Figure 9: SharePoint admin center

Click in the quick launch on Search and Manage Search Schema, as in Figure 10.

x10

Figure 10: Click Search and Managed Schema

A managed property is connected to a crawled property. You first have to see if your new column, Document Category, is created as a crawled property. This only happens after an index of your SharePoint Portal has been executed. The major downside of SharePoint Online, at least at the moment, is the inability to manually start an index. You are dependent on the schedule Microsoft created for your Office 365 tenant. You have no insight into this schedule. My advice? Be patient. In my experience this takes no longer than 15 minutes. Did you wait for 15 minutes? Good. Click on Crawled Properties, as shown in Figure 11.

x11

Figure 11: Crawled Properties

Enter Document Category, and click on the green arrow, as you see in Figure 12.

x12

Figure 12: Click the green arrow

You see 12 results. Which one should you choose?

Did you really think SharePoint was going to make your life easy? Of course not! No need to try out all of the results because we need the ows_DocumentCategory crawled property. For every managed metadata column you need to use the crawled property with _ows before the name of the site column.

Within SharePoint On-Premise we would use this crawled property and connect it to a new managed property. Unfortunately SharePoint Online doesn’t allow you to create a new managed property that can be used as search refiner. Don’t worry! Microsoft solved this by providing a lot of out-of-the-box managed properties which can be used as a refiner. Close call right? Click on Managed Properties, as shown in Figure 13.

x13

Figure 13: Managed Properties

Because you’re using a managed metadata column for your taxonomy, you have to connect the crawled property to a RefinableString managed property, as in Figure 14.

x14

Figure 14: Connecting to a RefinableString managed property.

Click on RefinableString00 to connect the crawled property to the DocumentCategory, as in Figure 15.

x15

Figure 15: Connect the crawled property

Next, click on Add a Mapping, and scroll to the top of the screen, as in Figure 16.

x16

Figure 16: Scroll to the top of the screen

You have to enter a Document Category and click on Find, as in Figure 17.

jo3

Figure 17: Click on Find

You select your crawled property, ows_DocumentCategory, and click on OK, and also OK in the configuration screen of the managed property. You are now ready to use your new refiner! Let’s go to the Search site and execute a search. Click on Site Actions and Edit Page, as in Figure 18.

x18

Figure 18: Executing a search

Browse over Refinement to open the web part properties, as you see in Figure 19.

x19

Figure 19: Opening the web part properties

Click on Choose Refiners as in Figure 20.

x20

Figure 20: Choosing refiners

You have to select your refiner on the left site under Available refiners, let’s look for RefinableString00 and move it to the selected refiners by clicking on Add >. Don’t forget to give the refiner a display name: Document Category. Save the new settings by clicking on OK, also press OK in the refinement panel web part settings, and publish the page.

I have to temper your excitement a little bit because there is a high chance the refiner won’t immediately be available. Your SharePoint Online Portal needs a full crawl to process the new configuration. Unfortunately you aren’t able to execute a full crawl, so you have to be patient. How patient? This can be an hour, two hours or even a whole day. Frustrating? I totally agree. I really hope Microsoft resolves this in the future. Eventually your refiner will be available, as you can see in Figure 21.

x21

Figure 21: The refiner is available

In this example, the search returns 25 search results, but you have your Document Category refiner. So after clicking on Contracts, you get only one result, as in Figure 22.

jo4

Figure 22: Results after clicking Contracts

You patience pays off because you can use the power of a taxonomy in combination with the  powerful SharePoint Online Search engine.

Original post at IT Unity.

 

You Might Also Like

15 Comments

  • Reply
    Paulo Fagundes
    June 20, 2014 at 11:22 am

    Hi Jasper,

    I see that you tag your documents with an hierarchical taxonomy, witch means you can tag a document to what level on your taxonomy you want.

    When using on search refiners, you loose that notion of hierarchy. I’ve tried to use a brand new webpart in SharePoint 2013, Taxonomy Rifinement Webpar, witch promises to give you the hierarchy refiner.

    All the screenshots of working examples are about product catalog. Do you know if this webpart only works in those cenarios?

  • Reply
    Jasper Oosterveld
    June 21, 2014 at 8:22 am

    Hi Paulo,

    Thanks for your valuable feedback, really appreciate it. I don’t have any experience with the Taxonomy Rifinement Webpart so unfortunately I can’t help you.

    Definitely something I want to look into soon!

  • Reply
    Andy
    September 24, 2014 at 5:42 am

    “Figure 12: Click the green arrow You see 12 results. Which one should you choose?”

    I only see one result: document category.

    Using SharePoint 2013 on Office 365.

    • Reply
      Andy
      September 24, 2014 at 5:48 am

      Got it!

      I put a space in between document and category so it was called: ows_Document_x0020_Category

  • Reply
    Jasper Oosterveld
    October 4, 2014 at 2:01 pm

    Hi Andy, sorry for not reaching out earlier. My apologies!

    I am assuming you found it? Every space is converted to x0020 😉

  • Reply
    Ximena Echeverri
    October 10, 2014 at 3:35 pm

    Hi Jasper, I have a problem, I made all the steps, until figure 11, but I can’t find my site column in the Crawled Properties, I waited more than 12 hours, and nothing happens. I don’t know what I do it wrong. I’m using sharepoint 2013 with office 365. Thanks.

  • Reply
    Jasper Oosterveld
    October 12, 2014 at 9:42 am

    Ho Ximena,

    What is the name of your site column? Did you add it to a document library and used it for a couple of documents?

    You are using SharePoint Online? One of the downsides of SharePoint Online is the uncertainty of the time interval of Search crawls. You should download the following tool:

    http://sp2013searchtool.codeplex.com/

    Run a Search query with the tool against the URL of the document library where you used the site column and applied it to the content. The results section at the right side of the screen has a tab called Raw. You should see the content here. You should be able to see the metadata of the content. Are you seeing if the metadata of the site column has been applied?

    • Reply
      Ximena Echeverri
      October 14, 2014 at 5:23 pm

      Hi Jasper, thanks for your answer; yes, I’m using Sharepoint Online, the name of my site column is TestPrueba, and I have four documents that use this. I downloaded the tool, and ran with my site, searching my site column, and the result was:
      {“d”:{“postquery”:{“__metadata”:{“type”:”Microsoft.Office.Server.Search.REST.SearchResult”},”ElapsedTime”:76,”PrimaryQueryResult”:{“__metadata”:{“type”:”Microsoft.Office.Server.Search.REST.QueryResult”},”CustomResults”:{“__metadata”:{“type”:”Collection(Microsoft.Office.Server.Search.REST.CustomResult)”},”results”:[]},”QueryId”:”7cf3067d-af68-46d3-a344-e5fed6e9d4f3″,”QueryRuleId”:”00000000-0000-0000-0000-000000000000″,”RefinementResults”:null,”RelevantResults”:{“__metadata”:{“type”:”Microsoft.Office.Server.Search.REST.RelevantResults”},”GroupTemplateId”:null,”ItemTemplateId”:null,”Properties”:{“results”:[{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”GenerationId”,”Value”:”9223372036854775806″,”ValueType”:”Edm.Int64″},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”indexSystem”,”Value”:””,”ValueType”:”Edm.String”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”ExecutionTimeMs”,”Value”:”47″,”ValueType”:”Edm.Int32″},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”QueryModification”,”Value”:”andnot(TestPrueba,filter(contentclass:\”urn:content-class:SPSPeople*\”))”,”ValueType”:”Edm.String”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”RenderTemplateId”,”Value”:”~sitecollection/_catalogs/masterpage/Display Templates/Search/Group_Default.js”,”ValueType”:”Edm.String”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”StartRecord”,”Value”:”0″,”ValueType”:”Edm.Int32″},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”IsFirstBlockInSubstrate”,”Value”:”true”,”ValueType”:”Edm.Boolean”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”IsLastBlockInSubstrate”,”Value”:”true”,”ValueType”:”Edm.Boolean”}]},”ResultTitle”:null,”ResultTitleUrl”:null,”RowCount”:0,”Table”:{“__metadata”:{“type”:”SP.SimpleDataTable”},”Rows”:{“results”:[]}},”TotalRows”:0,”TotalRowsIncludingDuplicates”:0},”SpecialTermResults”:null},”Properties”:{“results”:[{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”RowLimit”,”Value”:”10″,”ValueType”:”Edm.Int32″},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”SourceId”,”Value”:”8413cd39-2156-4e00-b54d-11efd9abdb89″,”ValueType”:”Edm.Guid”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”CorrelationId”,”Value”:”1f19c29c-20f9-1000-8d3d-47828d7c7c42″,”ValueType”:”Edm.Guid”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”WasGroupRestricted”,”Value”:”false”,”ValueType”:”Edm.Boolean”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”EnableInterleaving”,”Value”:”true”,”ValueType”:”Edm.Boolean”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”BlockRankLog”,”Value”:”No interleaving blocks\r\nDeduped 0 results due to pinned results\r\nNo blocks with available results to interleave\r\n”,”ValueType”:”Edm.String”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”piPageImpression”,”Value”:”33019704_3645_9226″,”ValueType”:”Edm.String”},{“__metadata”:{“type”:”SP.KeyValue”},”Key”:”SerializedQuery”,”Value”:””,”ValueType”:”Edm.String”}]},”SecondaryQueryResults”:{“__metadata”:{“type”:”Collection(Microsoft.Office.Server.Search.REST.QueryResult)”},”results”:[]},”SpellingSuggestion”:””,”TriggeredRules”:{“__metadata”:{“type”:”Collection(Edm.Guid)”},”results”:[]}}}}

  • Reply
    Jasper Oosterveld
    October 16, 2014 at 10:33 am

    What’s your e-mail? That way we can share screenshots.

  • Reply
    sukienki do ślubu cywilnego
    January 25, 2015 at 5:19 am

    This is really fascinating, You are a very skilled blogger.
    I have joined your feed and sit up for in quest
    of extra of your great post. Also, I have shared your
    website in my social networks!

  • Reply
    Daniel Hernandez
    September 30, 2015 at 10:55 am

    Hey Jasper Great Article!
    Thank you very much!

    I have two questions about it:

    1. Is it possible to add refiners to the default search you get in your home page?
    I wouldn’t like to creat a Search subsite to add the refiners but using them with the default search bar.

    2. I got to finish all the process but I have some problems with some users. I can perfectly see my new refiner but they can’t! How is that possible? and how I could solve it?

  • Reply
    Jasper Oosterveld
    October 1, 2015 at 7:05 am

    No worries Daniel.

    1. Are you able to edit that page and add refiners? If not, you have to create a new Search Result Page and refer to this page in your Site Settings.

    2. Do these users have permissions to see the documents, or content, related to the refiners. Could be that the security trimming is interfering.

  • Reply
    kane
    April 5, 2016 at 2:59 am

    Great written article! Do you know if there is anyway to display only Managed Metadata terms in the refiner? The issue I’m coming across was creating a Department column using MM terms. However, someone else at another site could create a Department column that is a string, choice, etc. Search doesn’t seem smart enough to pick up only MM columns.

  • Reply
    Jasper Oosterveld
    April 11, 2016 at 11:27 am

    Hi Kane, you assign one crawled property (the MM department) to a RefinableString. You use this for the refiner. That should solve your problem.

  • Reply
    Dan
    December 5, 2017 at 11:38 am

    Hello,

    If I may add something to your very useful post:

    if you just add the refinable managed property to the standard refiner, then you loose the hierarchy of terms in your search. This is bad since the tree-like relationship between terms is what separates a list of terms from a taxonomy.

    In order to preserve this taxonomy-information in the search page, we have created a webpart that complements the standard search webparts and which displays the terms in the hierarchy.

    You can get an idea of this TreeRefiner Webpart here: http://www.diqa-pm.de/en/Semantic_Search_Webparts#tabs-4

    All the best
    Daniel

  • Leave a Reply to Dan Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.