2012-08-02 36 views
0

我的数据存储,indexes.xml看起来是这样的:管理控制台GQL查询:上日期订货时指数未发现

<datastore-index kind="Book" ancestor="false" source="auto"> 
    <property name="^i" direction="asc"/> 
    <property name="nurInRange2" direction="asc"/> 
    <property name="firstModificationDate" direction="desc"/> 
</datastore-index> 

数据存储管理控制台实际上显示了这个在数据/资料储存库索引:

^i ▲ , nurInRange2 ▲ , firstModificationDate ▼ : serving 

但是呢,当我去到数据存储浏览器并执行by gql查询:

SELECT * FROM Book where nurInRange2 = True order by firstModificationDate DESC 

我收到以下回复:

no matching index found. 
The suggested index for this query is: 
    - kind: Book 
    properties: 
     - name: nurInRange5 
     - name: firstModificationDate 
     direction: desc 

有什么明显的我失踪了吗?我的指数公式有什么问题吗?

+0

什么是^ i属性(在索引中)为什么它在那里?它不是建议索引的一部分。你需要一个没有它的新索引。 – 2012-08-02 21:21:10

+1

@Shay:^ i属性(最可能)是Objectify的生成属性,需要多态:http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Implementation_Considerations – 2012-08-03 06:20:18

+0

10倍@PeterKnego我从来没有使用过物化。 – 2012-08-03 08:36:20

回答

0

如果要对其进行排序,则必须在过滤器中使用'firstModificationDate'。

有关更多信息,请参阅Restrictions on Queries