Friday, April 10, 2015

Indexing a list field in SharePoint

In a previous post, I had an error with users querying a large list due to the List View Threshold. Instead of increasing the list view threshold for non administrative users, I opted instead to index a key field on the list.

To index a field on a SharePoint list, the following steps can be followed:

  1. Navigate to the list you wish to index
  2. On the ribbon select List and then List Settings
  3. Below the list of columns you will see a link titled Indexed columns, click this
  4. Click Create a new index
  5. Here you can select up to 2 columns to index and then click create
Generally you would index the key column(s) which are used for looking up data. In my case there was a username field (which I would query with CAML to return all rows associated to that user). Once the index had been created there was no error related to the list view threshold.

No comments:

Post a Comment