GAE Datastore 复合索引不工作

GAE Datastore composite index not working

出于某种原因,我的 google 数据存储的复合索引之一无法正常工作。

我在以下查询中得到的结果为零:

SELECT * FROM `Foobar` WHERE `ver` = 20180814 AND `level` = 1

无论如何创建索引(虽然显示零大小,即使它是几天前创建的):

我仔细检查了这些字段都是整数,而且我在本地 sdk 上也得到了零结果。

index.yaml:

indexes:

- kind: Foobar
  properties:
  - name: ver
  - name: level
    direction: desc

正如@Dan 所指出的,复合索引仅在实体的 属性 本身被索引(内置)时才有效,请参阅: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