3.3 Database Index Setup
Last updated
Last updated
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.
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.
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.
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.
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.
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.
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.
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.
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: