Cengal Docs · Query

Fix a Missing Firestore Composite Index

Reproduce the query, verify Firebase’s exact index link, and rerun it after the index finishes building.

Safety baseline: verify the active identity, project, database, and environment before a connected write. Cengal stages changes for review; sample data stays local.

How to do it

  1. 01

    Open the intended account, project, database, and collection, then rebuild the failing query with the same filters, ordering, and limit.

  2. 02

    Run the query. Cengal’s preflight can flag likely index requirements, but only the Firestore response identifies the exact missing composite index.

  3. 03

    Read the error and verify that the generated link uses console.firebase.google.com, the expected project ID, and an index definition that matches the query before opening it.

  4. 04

    Create the index in Firebase Console. Cengal does not create indexes or change your Firestore configuration.

  5. 05

    Wait for Firebase to report that the index is ready, then rerun the unchanged query in Cengal.

  6. 06

    If the query still fails, check the active database, IAM permissions, and whether the first order field matches the inequality field.

A query to diagnose

Before

orders: status == "paid"; total > 100; order by total ascending; limit 20

After

If Firestore returns a missing-index error, review its generated status/total index definition in the expected project, wait for Ready, then rerun the same query.

This is a synthetic query example. Its index requirement depends on the indexes already present; an empty result alone is not an index error.

Know before you apply

  • A zero-result query and a missing-index failure are different outcomes. Do not add an index unless Firestore requests one or your query design requires it.
  • Index creation is a Firebase project change and may affect storage and write costs; review the definition with the project owner.
  • Cengal validates the host before offering an index link, but you should still verify the project and database context.

Related workflows

Official references

Learn more about the underlying Firestore behavior in Google’s documentation.

Still blocked?

Try the troubleshooting guide first. If the problem remains, email support@cengal.app with the Cengal version and non-sensitive error text. Never send OAuth tokens, service-account JSON, private keys, or customer documents.