Issues with GQL query, Google Datastore. Error with multiple conditions and greater than and less than operators

The error you get is because the query you're attempting requires Composite indexes which are not available by default. They must be specified within index.yaml.

The article Creating index files which is somewhat different than the one posted is specifically for Java applications running in the flexible environment.

There are 2 ways to create an index.yaml:

  1. Manually using your favorite text editor following the rules and structure as prescribed in Index definitions.
  2. Generate the file as you test locally. This can be done using the gcloud beta emulators datastore start command. You can also use the --data-dir <dir> option to specify where the generated index.yaml should be written.

Then, once you have index.yaml and the same directory as app.yaml, you can deploy it with gcloud preview app deploy index.yaml from that directory. This process is briefly documented in Deploying the index file.

I would also recommend reading Organizing yaml Configuration Files.