Documents in workspaces with more than 5 000 documents (SharePoint’s list view threshold), cannot be sorted unless these columns are first indexed. A good approach, when you hit this SharePoint limitation, is to either decrease the number of documents in the workspace by deleting old documents that maybe are not needed anymore or by moving documents in the workspace to other workspaces, e.g. archive workspaces.
If you still need to have more than 5 000 documents in the workspace, you probably should index some columns, at least the ones that that you want to be able to filter and sort on. By default the “Modified” column is indexed. There are a few caveats though as all types of columns cannot be indexed. These are MetaShare’s supported column types that can be indexed:
- Single line of text columns
- Date columns
- Yes/No (check box) columns
- Number columns
- Choice columns (if they do not allow multiple values)
- Person or Group columns (if they do not allow multiple values)
- Managed Metadata columns (if they do not allow multiple values)
These columns cannot be indexed:
- The standard “File name” column
- The standard “File type” column
- Multiple lines of text columns
- Choice columns (if they allow multiple values)
- Person or Group columns (if they allow multiple values)
- Managed Metadata columns (if they allow multiple values)
Documents can therefore not be sorted on or filtered on by these columns, unless you first narrow down the number of documents to less than 5 000 documents, by applying a filter on any of the indexed columns.
You can add indexes on up to 20 columns on a document library. It’s however recommended that you only add indexes to the most commonly used columns as indexes add overhead to the data and therefore decrease performance. Once you have indexed a column, you will be able to filter on its values and also sort on the column. Follow these steps to create an index in a document library:
- Open the workspace’s SharePoint site.
- Open the document library’s settings by clicking on “Site contents” on the left navigation, then clicking on the ellipsis (three vertical dots) and selecting the “Settings” option:
- Under the “Columns” section, click on the “Indexed columns” link:
- On the Indexed columns page, click on the “Create a new index” link:
- Select the column that you want to index, in the drop-down for the “Primary Column” and click on the “Create” button (no “Secondary Column” should be selected):
- Do step 4 and 5 above for the rest of the columns that you want to index. In general we would recommend to index these columns:
- Checked Out To (to be able to receive tasks for checked out documents)
- Content type (to be able to show folder as a document filter)
- Created (to be able to sort and filter on the column)
- Created By (to be able to sort and filter on the column)
- Modified (to be able to sort and filter on the column)
- Modified By (to be able to sort and filter on the column)
- Any custom column that you would like to filter on or sort on, specifically review date columns used for tasks of type “passed due date”, else they will not be able to be shown as tasks.