Odd search results in SharePoint and how to improve them

Search in SharePoint is a powerful but mysterious thing, and sometimes it just won’t do what you expect. There is much to learn about configuring and optimising the search experience – but let’s leave that to the SharePoint gurus. In this article I focus on simple things that every user can do to improve document search-ability.

SharePoint search fundamentals

In a nutshell, SharePoint has a default algorithm to match search queries to content. The algorithm takes into account numerous factors, but it values document titles and headings inside documents mostly highly.

Document titles

As a general rule the SharePoint search engine likes to use the titles of documents. This sounds simple but it’s important to realise that document titles are not the same as document names:

  • The document name is the ‘display name’ of the document. The document name is visible when you create or upload a document to a library.
  • The document title is a ‘hidden’ property. You only see the document title when you edit the document’s properties in a library or the relevant app.

This image shows where to find a document’s name and title in the properties panel in a SharePoint library:

Property panel in SharePoint library showing name and title

This image shows where to find a document’s name and title in the properties panel of Microsoft Word 2016:

Panel showing Title and Name in Microsoft Word

While document names are more visible and added when you upload or create a document, you must manually enter a document title. Unfortunately titles are often left blank or are incorrect because they are not immediately visible and users don’t understand their purpose.

Incorrect titles

You often find incorrect titles when a document is created by copying an existing document. For example, when a report template has the document title of ‘Report Template’ and dozens of documents are generated by copying it. The copies will all have the same, erroneous title ‘Report Template’ and will appear in search results for the words ‘report template’.

More importantly, SharePoint prominently displays the document title on the search results page. The document name is only present in the url at the bottom.

Search results in SharePoint showing name and title

In the template example above you would have dozens of search results with the title ‘Report Template’.

So, for better search results make sure your titles are correct and reflect your documents’ contents. Try adding the ‘Title’ column to your libraries. This simple mechanism provides users with a visual trigger to check the title of their documents.

Name and title columns in document library

Blank titles

SharePoint has a feature called the ‘MetadataTitleExtractor’ to deal with blank titles. It populates a document’s title based on the headings inside the document. The extracted title is only used by SharePoint search and is not displayed in the ‘Title’ column in the library.

This image shows search results populated with a heading inside a document:

Search Centre showing results of Heading 1 in a document

Adding a title will overwrite ‘MetadataTitleExtractor’. It doesn’t happen instantly though; it may take up to 24 hours depending on your search crawl settings.

Headings inside documents

So you’ve entered your document titles, but you’re not happy with the ranking of search results? It may be due to SharePoint giving headings inside your documents higher priority over document titles when ordering search results.
Word document with a Heading 1

Usually this approach is very helpful because we cannot always rely on the title, and headings can tell us a lot about a document’s contents. Sometimes though it’s a problem. For example, one of our clients had a Word document containing only a map inserted as an image. The first content the ‘MetadataTitleExtractor’ could pull from inside the document was the ‘LEGEND’ text next to the map.

Word document with no Heading 1 or title

In situations like this you can correctly title the document and add a descriptive H1 heading as a back-up.

If all else fails, you can ask your SharePoint administrator to adjust the Search Schema by pushing ‘MetadataExtractorTitle’ right to the bottom of the priority order.

While in the example above the ‘MetadataExtractorTitle’ has returned unhelpful search results, it’s important to remember before you adjust the Search Schema that you are affecting default behaviour and headings are often the most meaningful descriptions of a document. Seriously consider the impacts before you make the change.

Still confused? Search in SharePoint can be complicated so get in touch if you have any questions. We are a team of SharePoint consultants, based in Brisbane, who are happy to help!