Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.

google.appengine.datastore.datastore_index.IndexXmlForQuery

Returns the composite index definition XML needed for a query.

Given a query, the arguments for this method can be computed with:

  _, kind, ancestor, props = datastore_index.CompositeIndexForQuery(query)
  props = datastore_index.GetRecommendedIndexProperties(props)

kind The kind or None
ancestor True if this is an ancestor query, False otherwise.
props PropertySpec objects.

A string with the XML for the composite index needed by the query.