CMS: Adding an Index for Your Collection
8 min
In this article
- Understanding index types
- Regular indexes
- Unique indexes
- About automatic indexes
- Index quotas
- Creating an index for your collection
- FAQs
Set up indexes in your Wix CMS to optimize data retrieval times. You can choose between creating regular or unique indexes based on your specific needs.
Think of your collection as a database full of information which represents your content. To display this content on a page, the CMS (Content Management System) performs database searches. As your content grows, these searches can take longer, affecting the speed at which information is retrieved.
User input elements also influence database searches. For example, a dropdown input element may display a list of options from your collection. When site visitors click this dropdown, they are effectively searching your collection.
Indexes serve as shortcuts that map the structure of your data, allowing the CMS to retrieve information more efficiently. By creating an index, you help the system avoid scanning the entire database each time a search is performed. This significantly speeds up data retrieval, especially when your collection contains many items, ultimately enhancing the user experience on your site.

Understanding index types
Choosing the right index type for your CMS collection is key to meeting your data needs. There are two main types: regular indexes and unique indexes.
Regular indexes
A regular index is designed to enhance data retrieval speed by allowing you to search across multiple fields within your collection. Use this type if you need to optimize performance for queries involving multiple fields. Regular indexes can include up to three fields, making them ideal for queries that filter or sort based on various attributes.
Tips:
- When creating a regular index, choose fields that match the most frequent queries on your site. For example, if you have a real estate site and you use a repeater to show the most popular houses for sale on your homepage, you could create an index that includes the fields: 'City', 'Property type', and 'Most popular'. If your queries use different filters for different searches, it’s best to create separate indexes for each filter set.
- For the best performance, ensure the sort order of your dataset or queries matches the order defined in your index.

Unique indexes
A unique index enforces data integrity by ensuring that values in a specific field are distinct across all collection items. This type of index is limited to one field and is ideal for scenarios where each entry must be unique, such as user IDs, email addresses, or product SKUs. It automatically prevents duplicates by rejecting attempts to add or update items with identical values.
For example, if you create a unique index for email addresses, it will prevent duplicate entries, ensuring that each email address in your collection remains unique. This is especially crucial for user accounts or any dataset where duplicates could cause confusion or errors.

About automatic indexes
For large collections with high query volumes, Wix automatically identifies slow-running queries and creates indexes to improve performance. This automatic indexing service works behind the scenes to optimize data retrieval without any action required from you.
Automatic indexes are designed to speed up your most common queries by analyzing your collection's usage patterns. They include sort and filter keys based on the queries your site visitors are making. You can identify automatic indexes by the "Auto-indexed" label in your indexes manager
Key things to know about automatic indexes:
- They don't use your quota: Automatic indexes don't count toward your index limit, so you can still create all your user-defined indexes.
- They're dynamic: The system may remove automatic indexes if they're no longer beneficial. If you want to keep a suggested index permanently, delete the automatic index and create an identical user index in its place.
- They apply to large collections: Automatic indexing is designed for collections with substantial content and traffic that benefit most from query optimization.
Note:
If you create a manual index that uses the same fields as an automatic index, your manual index takes priority and the automatic index is removed automatically.
Index quotas
The number of indexes you can create depends on your site plan:
- Free and upgraded sites: Up to 4 user-created indexes per collection (1 unique index + 3 regular indexes).
- Sites with the Business Elite or Elite plans: Up to 15 user-created indexes per collection:
- 2 unique indexes.
- 13 regular indexes (up to 5 three-field indexes and 8 single-field indexes).
In addition to the indexes you create, Wix may automatically create indexes for large collections to optimize query performance. These automatic indexes do not count toward your quota and can be identified by the "Auto-indexed" label in your indexes manager.
You can upgrade your site if you need additional indexes.
Note:
System indexes (like the ID or creation date fields) do not count toward this quota.
Creating an index for your collection
Go to your collection in the CMS to create regular or unique indexes that optimize how your collection retrieves and organizes data.
To create an index:
- Go to CMS in your site's dashboard.
- Click the relevant collection.
- Click the More Actions drop-down at the top right and select Indexes.
- Click + Add Index.
- Choose the type of index you want to create: Regular or Unique
Regular
Unique
FAQs
Click below for answers to common questions about indexing collection data.
Where can I find more advanced documentation about using indexes with coding?
How many indexes can I create?
What are system indexes?
When should I add an index to my collection?
Are there times when I shouldn't add an index?
Which fields are unsuitable for indexes?
Can I remove or edit indexes I create?
What happens if I try to add a duplicate value to a unique index?
What are automatic indexes and how do they work?





