# 3.3 Database Index Setup

You have to create **8 indexes** for the database one by one. From the Firestore Database, Click on the **Indexes** tab and click on the **Add Index**. You have to create **8 indexes** for the database.

> 1. Enter **articles** as Collection ID, **status** into the first field and set **Ascending**, Enter **views** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 2. Enter **articles** as Collection ID, **content\_type** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **created\_at**  in the third field and set **Descending,** Enter **\_\_name\_\_**  in the fourth field and set **Descending** and then select **Collection** as query scope and save it.
> 3. Enter **comments** as Collection ID, **article\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 4. Enter **articles** as Collection ID, **category.id** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **created\_at** in the third field and set **Descending,** Enter **\_\_name\_\_**  in the fourth field and set **Descending** and then select **Collection** as query scope and save it.
> 5. Enter **articles** as Collection ID, **status** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,**  Enter **\_\_name\_\_** in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 6. Enter **articles** as Collection ID, **featured** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **views** in the third field and set **Descending,** Enter **\_\_name\_\_**  in the fourth field and set **Descending** and then select **Collection** as query scope and save it.
> 7. Enter **articles** as Collection ID, **content\_type** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **views** in the third field and set **Descending,** Enter **\_\_name\_\_**  in the fourth field and set **Descending** and then select **Collection** as query scope and save it.
> 8. Enter **comments** as Collection ID, **article\_author\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.

This may take 3-5 minutes to activate. After completing this, your index page should look like this:

<div align="left"><figure><img src="https://503170080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLNfw7ZA0Eb8JL71w4H2T%2Fuploads%2FVADLYGAk8IR7iOwpcTEd%2FScreenshot%202024-07-11%20at%203.21.16%20PM.png?alt=media&#x26;token=16687a8d-2f76-42cd-9e2c-2527f33b1810" alt=""><figcaption></figcaption></figure></div>
