Results, but an unresolved issue:
As noted in the comments, I used an index.yaml file and the following command to add the index:
gcloud datastore indexes create index.yaml --database=mydatabase
After a short time, the indexes appeared in the Console, but but for many hours, the Size and Entries columns were blank. Finally, after over 24 hours, the indexes are populated.
In the meantime, I found a bug in my code. [Of course; things are never straightforward.] As of this moment, my application is working. However
This command still doesn't work
gcloud datastore indexes list --project="myproject"
The response is still
ERROR: (gcloud.datastore.indexes.list) Projects instance [myproject] not found: Project 'myproject' does not exist.
Finally, the indexing process seems shockingly slow for a test database of this size. Here is the data from the Datastore Dashboard:
Entity count | 530 |
---|---|
Built-in index size | 956.57 KB |
Composite index size | 251.49 KB |
Data size | 787.74 KB |
Total size | 1.95 MB |
Last updated | Jun 22, 2025, 9:00:00 AM |
I am going to mark this as answered. But if you are reading this because you have a similar problem, I can offer only a few ideas that might help:
Do not use any "optional" fields in your composite indexes. RE:
https://cloud.google.com/datastore/docs/concepts/indexes#index_definition_and_structure
"An entity is included in the index only if it has an indexed value set for every property used in the index; if the index definition refers to a property for which the entity has no value, that entity won't appear in the index and hence will never be returned as a result for any query based on the index."
Make sure that no queries depend on fields that are not in your composite indexes.
https://cloud.google.com/datastore/docs/concepts/queries#query_interface
"The properties being filtered on must have a corresponding predefined index which can be defined in your index configuration file"
Be patient; the indexing process takes a long time. I think the update to the dashboard statistics takes even longer.