> For the complete documentation index, see [llms.txt](https://doc-primelms.mrb-lab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc-primelms.mrb-lab.com/admin-setup/3.-firebase-setup/3.3-database-index-setup.md).

# 3.3 Database Index Setup

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

> 1. Enter **reviews** as Collection ID, **course\_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.
> 2. Enter **courses** as Collection ID, **cat\_id** into the first field and set **Ascending**, Enter **id** in the second field and set **Ascending,** Enter **\_\_name\_\_**  in the third field and set **Ascending** and then select **Collection** as query scope and save it.
> 3. Enter **courses** 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.
> 4. Enter **reviews** as Collection ID, **course\_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.
> 5. Enter **courses** as Collection ID, **cat\_id** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **id**  in the third field and set **Ascending,** Enter **\_\_name\_\_** in the fourth field and set **Ascending** 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:

<figure><img src="/files/ZSrCkm3igMxTkczhyrRW" alt=""><figcaption></figcaption></figure>
