CMS: Adding an Index for Your Collection

2 min read
Think of your collection as a database full of information. This information is your content. In order for your content to appear on a page, the CMS (Content Management System) finds it by carrying out a database search. The more content you have, the longer it takes the CMS to find what it is looking for.
User inputs also impact database searches. A page can have a drop-down input to display a list of options from a collection. When site visitors click on the drop-down, they are searching your collection (or database).
An index (or database index) maps the structure of your data. This way, a data search has a shortcut to the information it is looking for. The data recovery is faster because it doesn't have to search the entire database every time.
If you expect your collection to contain many items, an index will reduce the time spent on data searches. This improves the end user experience.

To set up an index for your collection:

  1. Go to CMS in your site's dashboard.
  2. Click the relevant collection.
  3. Click More Actions.
A screenshot of a collection in the Content Manager, highlighting the Indexes option.
  1. Click Indexes.
  2. Click + New Index.
  3. Type a name for your index in the Index Name field.
  4. Click the Type drop-down to select a regular or unique index:
    • Regular: Create an index using up to 3 fields with a diverse range of values. Fields with a narrow range of values, like booleans, do not make good indexes. Click the Choose a field drop-down and select a field on which to base your index. Click + Add Field to add more fields.
    • Unique: Create an index with fields that won't have duplicate values (e.g. ID number or email address). A unique index is limited to 1 field. Click the Choose a field drop-down and select a field on which to base your index. Learn more about unique indexes in Velo by Wix. 
  5. Click the Sort drop-down to select Ascending or Descending for each field.
  6. Click Save.
Learn more about Indexes and Wix Data Collections in Velo by Wix.

Did this help?