How Indexing Columns works in SharePoint Online?

Introduction

To begin with, what does "Index" signify in relation to this? In simple terms, an "index" typically refers to an organized list or systematic arrangement of items.

Then let’s see how this Indexing works in SharePoint:

What is indexing in SharePoint?

Indexed columns in SharePoint enhance performance in lists, particularly when frequent column filtering and querying occur. In SharePoint, Indexed columns store the specific value as an identifier, and that can be used as a query for particular values based on their identifier, which improves the performance of the search results and other querying and filtering on those columns.

As of now, we are allowed to add 20 columns per list or library as an index column, which must be often used columns that we regularly use to query or as a filter.

Another crucial aspect of indexing columns becomes evident when dealing with lists or libraries containing over 5000 items. If there is a need to retrieve specific rows based on filters applied to certain columns, then we might get the threshold issue.

Indexing Column is a similar function to Indexing Database for better querying and performance.

How to Index SharePoint Columns?

SharePoint Index Columns can be generated through various methods, either directly within the library or by utilizing PowerShell.

Indexing Column in SharePoint Online List/Library

To create an indexed column in SharePoint Online List/Library, follow these steps.

  • Navigate to List/Library and open the Settings of that List/Library.
  • Locate the Column section, where you will find the option to set an Indexed Column.
    Indexed Columns
  • Now open the Index Column Page and Click on “Create a new index”.
    Create a new Index
  • Choose a column from the drop-down menu within the Primary Column section. Click on the "Create" button. This action establishes an index on the list.
    Edit index

Henceforth, the column will function as an indexed column.

Make sure that not all column types are available for use as indexed columns. Below are some columns that cannot be utilized as indexed columns.

  1. Multiple lines of text
  2. Choice [multi-valued]
  3. Calculated
  4. Hyperlink or Picture
  5. Person or Group [multi-valued] [Lookup]
  6. External data

Indexing Column in SharePoint Online PowerShell

Here is a PnP PowerShell script for adding an Index Column to any List or Library.

$SiteURL = "https://contoso.sharepoint.com"
$ListName = "SitePages"
$ColumnName = "Title"
 
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
 
$SiteContext = Get-PnPContext
$ColumnField = Get-PnPField -List $ListName -Identity $ColumnName
 
#Set the Indexed Property of the Field
$ColumnField.Indexed = $True
$ColumnField.Update()
$SiteContext.ExecuteQuery()

Hence, Establishing an index column in SharePoint Online is a straightforward and uncomplicated procedure that can significantly enhance the effectiveness of our information management. With an index column, users can swiftly and effortlessly search and filter their data.

I hope this article has provided you with insight into the SharePoint Online Indexing List/Library Columns.

You can Join me on LinkedIn to follow my learning journey and stay updated with my latest insights and discoveries.